Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ast: Rename to_ast_private() to to_ast_device()

The helper to_ast_private() now upcasts to struct ast_device. Rename
it accordingly. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230221155745.27484-5-tzimmermann@suse.de

+46 -46
+5 -5
drivers/gpu/drm/ast/ast_dp.c
··· 9 9 10 10 int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata) 11 11 { 12 - struct ast_device *ast = to_ast_private(dev); 12 + struct ast_device *ast = to_ast_device(dev); 13 13 u8 i = 0, j = 0; 14 14 15 15 /* ··· 125 125 u8 bDPTX = 0; 126 126 u8 bDPExecute = 1; 127 127 128 - struct ast_device *ast = to_ast_private(dev); 128 + struct ast_device *ast = to_ast_device(dev); 129 129 // S3 come back, need more time to wait BMC ready. 130 130 if (bPower) 131 131 WaitCount = 300; ··· 172 172 173 173 void ast_dp_power_on_off(struct drm_device *dev, bool on) 174 174 { 175 - struct ast_device *ast = to_ast_private(dev); 175 + struct ast_device *ast = to_ast_device(dev); 176 176 // Read and Turn off DP PHY sleep 177 177 u8 bE3 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xE3, AST_DP_VIDEO_ENABLE); 178 178 ··· 188 188 189 189 void ast_dp_set_on_off(struct drm_device *dev, bool on) 190 190 { 191 - struct ast_device *ast = to_ast_private(dev); 191 + struct ast_device *ast = to_ast_device(dev); 192 192 u8 video_on_off = on; 193 193 194 194 // Video On/Off ··· 208 208 209 209 void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode) 210 210 { 211 - struct ast_device *ast = to_ast_private(crtc->dev); 211 + struct ast_device *ast = to_ast_device(crtc->dev); 212 212 213 213 u32 ulRefreshRateIndex; 214 214 u8 ModeIdx;
+10 -10
drivers/gpu/drm/ast/ast_dp501.c
··· 18 18 19 19 static int ast_load_dp501_microcode(struct drm_device *dev) 20 20 { 21 - struct ast_device *ast = to_ast_private(dev); 21 + struct ast_device *ast = to_ast_device(dev); 22 22 int ret; 23 23 24 24 ret = request_firmware(&ast->dp501_fw, "ast_dp501_fw.bin", dev->dev); ··· 106 106 107 107 static bool ast_write_cmd(struct drm_device *dev, u8 data) 108 108 { 109 - struct ast_device *ast = to_ast_private(dev); 109 + struct ast_device *ast = to_ast_device(dev); 110 110 int retry = 0; 111 111 if (wait_nack(ast)) { 112 112 send_nack(ast); ··· 128 128 129 129 static bool ast_write_data(struct drm_device *dev, u8 data) 130 130 { 131 - struct ast_device *ast = to_ast_private(dev); 131 + struct ast_device *ast = to_ast_device(dev); 132 132 133 133 if (wait_nack(ast)) { 134 134 send_nack(ast); ··· 146 146 #if 0 147 147 static bool ast_read_data(struct drm_device *dev, u8 *data) 148 148 { 149 - struct ast_device *ast = to_ast_private(dev); 149 + struct ast_device *ast = to_ast_device(dev); 150 150 u8 tmp; 151 151 152 152 *data = 0; ··· 185 185 186 186 bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size) 187 187 { 188 - struct ast_device *ast = to_ast_private(dev); 188 + struct ast_device *ast = to_ast_device(dev); 189 189 u32 i, data; 190 190 u32 boot_address; 191 191 ··· 204 204 205 205 static bool ast_launch_m68k(struct drm_device *dev) 206 206 { 207 - struct ast_device *ast = to_ast_private(dev); 207 + struct ast_device *ast = to_ast_device(dev); 208 208 u32 i, data, len = 0; 209 209 u32 boot_address; 210 210 u8 *fw_addr = NULL; ··· 274 274 275 275 bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata) 276 276 { 277 - struct ast_device *ast = to_ast_private(dev); 277 + struct ast_device *ast = to_ast_device(dev); 278 278 u32 i, boot_address, offset, data; 279 279 u32 *pEDIDidx; 280 280 ··· 334 334 335 335 static bool ast_init_dvo(struct drm_device *dev) 336 336 { 337 - struct ast_device *ast = to_ast_private(dev); 337 + struct ast_device *ast = to_ast_device(dev); 338 338 u8 jreg; 339 339 u32 data; 340 340 ast_write32(ast, 0xf004, 0x1e6e0000); ··· 407 407 408 408 static void ast_init_analog(struct drm_device *dev) 409 409 { 410 - struct ast_device *ast = to_ast_private(dev); 410 + struct ast_device *ast = to_ast_device(dev); 411 411 u32 data; 412 412 413 413 /* ··· 434 434 435 435 void ast_init_3rdtx(struct drm_device *dev) 436 436 { 437 - struct ast_device *ast = to_ast_private(dev); 437 + struct ast_device *ast = to_ast_device(dev); 438 438 u8 jreg; 439 439 440 440 if (ast->chip == AST2300 || ast->chip == AST2400) {
+1 -1
drivers/gpu/drm/ast/ast_drv.h
··· 210 210 const struct firmware *dp501_fw; /* dp501 fw */ 211 211 }; 212 212 213 - static inline struct ast_device *to_ast_private(struct drm_device *dev) 213 + static inline struct ast_device *to_ast_device(struct drm_device *dev) 214 214 { 215 215 return container_of(dev, struct ast_device, base); 216 216 }
+4 -4
drivers/gpu/drm/ast/ast_i2c.c
··· 29 29 static void ast_i2c_setsda(void *i2c_priv, int data) 30 30 { 31 31 struct ast_i2c_chan *i2c = i2c_priv; 32 - struct ast_device *ast = to_ast_private(i2c->dev); 32 + struct ast_device *ast = to_ast_device(i2c->dev); 33 33 int i; 34 34 u8 ujcrb7, jtemp; 35 35 ··· 45 45 static void ast_i2c_setscl(void *i2c_priv, int clock) 46 46 { 47 47 struct ast_i2c_chan *i2c = i2c_priv; 48 - struct ast_device *ast = to_ast_private(i2c->dev); 48 + struct ast_device *ast = to_ast_device(i2c->dev); 49 49 int i; 50 50 u8 ujcrb7, jtemp; 51 51 ··· 61 61 static int ast_i2c_getsda(void *i2c_priv) 62 62 { 63 63 struct ast_i2c_chan *i2c = i2c_priv; 64 - struct ast_device *ast = to_ast_private(i2c->dev); 64 + struct ast_device *ast = to_ast_device(i2c->dev); 65 65 uint32_t val, val2, count, pass; 66 66 67 67 count = 0; ··· 83 83 static int ast_i2c_getscl(void *i2c_priv) 84 84 { 85 85 struct ast_i2c_chan *i2c = i2c_priv; 86 - struct ast_device *ast = to_ast_private(i2c->dev); 86 + struct ast_device *ast = to_ast_device(i2c->dev); 87 87 uint32_t val, val2, count, pass; 88 88 89 89 count = 0;
+3 -3
drivers/gpu/drm/ast/ast_main.c
··· 66 66 static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) 67 67 { 68 68 struct device_node *np = dev->dev->of_node; 69 - struct ast_device *ast = to_ast_private(dev); 69 + struct ast_device *ast = to_ast_device(dev); 70 70 struct pci_dev *pdev = to_pci_dev(dev->dev); 71 71 uint32_t data, jregd0, jregd1; 72 72 ··· 122 122 123 123 static int ast_detect_chip(struct drm_device *dev, bool *need_post) 124 124 { 125 - struct ast_device *ast = to_ast_private(dev); 125 + struct ast_device *ast = to_ast_device(dev); 126 126 struct pci_dev *pdev = to_pci_dev(dev->dev); 127 127 uint32_t jreg, scu_rev; 128 128 ··· 271 271 static int ast_get_dram_info(struct drm_device *dev) 272 272 { 273 273 struct device_node *np = dev->dev->of_node; 274 - struct ast_device *ast = to_ast_private(dev); 274 + struct ast_device *ast = to_ast_device(dev); 275 275 uint32_t mcr_cfg, mcr_scu_mpll, mcr_scu_strap; 276 276 uint32_t denum, num, div, ref_pll, dsel; 277 277
+15 -15
drivers/gpu/drm/ast/ast_mode.c
··· 645 645 struct drm_atomic_state *state) 646 646 { 647 647 struct drm_device *dev = plane->dev; 648 - struct ast_device *ast = to_ast_private(dev); 648 + struct ast_device *ast = to_ast_device(dev); 649 649 struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); 650 650 struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); 651 651 struct drm_framebuffer *fb = plane_state->fb; ··· 683 683 static void ast_primary_plane_helper_atomic_enable(struct drm_plane *plane, 684 684 struct drm_atomic_state *state) 685 685 { 686 - struct ast_device *ast = to_ast_private(plane->dev); 686 + struct ast_device *ast = to_ast_device(plane->dev); 687 687 struct ast_plane *ast_plane = to_ast_plane(plane); 688 688 689 689 /* ··· 699 699 static void ast_primary_plane_helper_atomic_disable(struct drm_plane *plane, 700 700 struct drm_atomic_state *state) 701 701 { 702 - struct ast_device *ast = to_ast_private(plane->dev); 702 + struct ast_device *ast = to_ast_device(plane->dev); 703 703 704 704 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x20); 705 705 } ··· 888 888 struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); 889 889 struct drm_framebuffer *fb = plane_state->fb; 890 890 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); 891 - struct ast_device *ast = to_ast_private(plane->dev); 891 + struct ast_device *ast = to_ast_device(plane->dev); 892 892 struct iosys_map src_map = shadow_plane_state->data[0]; 893 893 struct drm_rect damage; 894 894 const u8 *src = src_map.vaddr; /* TODO: Use mapping abstraction properly */ ··· 943 943 static void ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane, 944 944 struct drm_atomic_state *state) 945 945 { 946 - struct ast_device *ast = to_ast_private(plane->dev); 946 + struct ast_device *ast = to_ast_device(plane->dev); 947 947 948 948 ast_set_cursor_enabled(ast, false); 949 949 } ··· 1007 1007 1008 1008 static void ast_crtc_dpms(struct drm_crtc *crtc, int mode) 1009 1009 { 1010 - struct ast_device *ast = to_ast_private(crtc->dev); 1010 + struct ast_device *ast = to_ast_device(crtc->dev); 1011 1011 u8 ch = AST_DPMS_VSYNC_OFF | AST_DPMS_HSYNC_OFF; 1012 1012 struct ast_crtc_state *ast_state; 1013 1013 const struct drm_format_info *format; ··· 1064 1064 static enum drm_mode_status 1065 1065 ast_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) 1066 1066 { 1067 - struct ast_device *ast = to_ast_private(crtc->dev); 1067 + struct ast_device *ast = to_ast_device(crtc->dev); 1068 1068 enum drm_mode_status status; 1069 1069 uint32_t jtemp; 1070 1070 ··· 1189 1189 struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, 1190 1190 crtc); 1191 1191 struct drm_device *dev = crtc->dev; 1192 - struct ast_device *ast = to_ast_private(dev); 1192 + struct ast_device *ast = to_ast_device(dev); 1193 1193 struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state); 1194 1194 struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info; 1195 1195 ··· 1214 1214 static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state) 1215 1215 { 1216 1216 struct drm_device *dev = crtc->dev; 1217 - struct ast_device *ast = to_ast_private(dev); 1217 + struct ast_device *ast = to_ast_device(dev); 1218 1218 struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); 1219 1219 struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state); 1220 1220 struct ast_vbios_mode_info *vbios_mode_info = ··· 1236 1236 { 1237 1237 struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); 1238 1238 struct drm_device *dev = crtc->dev; 1239 - struct ast_device *ast = to_ast_private(dev); 1239 + struct ast_device *ast = to_ast_device(dev); 1240 1240 1241 1241 ast_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); 1242 1242 ··· 1324 1324 1325 1325 static int ast_crtc_init(struct drm_device *dev) 1326 1326 { 1327 - struct ast_device *ast = to_ast_private(dev); 1327 + struct ast_device *ast = to_ast_device(dev); 1328 1328 struct drm_crtc *crtc = &ast->crtc; 1329 1329 int ret; 1330 1330 ··· 1350 1350 { 1351 1351 struct ast_vga_connector *ast_vga_connector = to_ast_vga_connector(connector); 1352 1352 struct drm_device *dev = connector->dev; 1353 - struct ast_device *ast = to_ast_private(dev); 1353 + struct ast_device *ast = to_ast_device(dev); 1354 1354 struct edid *edid; 1355 1355 int count; 1356 1356 ··· 1456 1456 { 1457 1457 struct ast_sil164_connector *ast_sil164_connector = to_ast_sil164_connector(connector); 1458 1458 struct drm_device *dev = connector->dev; 1459 - struct ast_device *ast = to_ast_private(dev); 1459 + struct ast_device *ast = to_ast_device(dev); 1460 1460 struct edid *edid; 1461 1461 int count; 1462 1462 ··· 1733 1733 1734 1734 static void ast_mode_config_helper_atomic_commit_tail(struct drm_atomic_state *state) 1735 1735 { 1736 - struct ast_device *ast = to_ast_private(state->dev); 1736 + struct ast_device *ast = to_ast_device(state->dev); 1737 1737 1738 1738 /* 1739 1739 * Concurrent operations could possibly trigger a call to ··· 1754 1754 const struct drm_display_mode *mode) 1755 1755 { 1756 1756 static const unsigned long max_bpp = 4; /* DRM_FORMAT_XRGB8888 */ 1757 - struct ast_device *ast = to_ast_private(dev); 1757 + struct ast_device *ast = to_ast_device(dev); 1758 1758 unsigned long fbsize, fbpages, max_fbpages; 1759 1759 1760 1760 max_fbpages = (ast->vram_fb_available) >> PAGE_SHIFT;
+8 -8
drivers/gpu/drm/ast/ast_post.c
··· 39 39 40 40 void ast_enable_vga(struct drm_device *dev) 41 41 { 42 - struct ast_device *ast = to_ast_private(dev); 42 + struct ast_device *ast = to_ast_device(dev); 43 43 44 44 ast_io_write8(ast, AST_IO_VGA_ENABLE_PORT, 0x01); 45 45 ast_io_write8(ast, AST_IO_MISC_PORT_WRITE, 0x01); ··· 47 47 48 48 void ast_enable_mmio(struct drm_device *dev) 49 49 { 50 - struct ast_device *ast = to_ast_private(dev); 50 + struct ast_device *ast = to_ast_device(dev); 51 51 52 52 ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa1, 0x06); 53 53 } ··· 55 55 56 56 bool ast_is_vga_enabled(struct drm_device *dev) 57 57 { 58 - struct ast_device *ast = to_ast_private(dev); 58 + struct ast_device *ast = to_ast_device(dev); 59 59 u8 ch; 60 60 61 61 ch = ast_io_read8(ast, AST_IO_VGA_ENABLE_PORT); ··· 70 70 static void 71 71 ast_set_def_ext_reg(struct drm_device *dev) 72 72 { 73 - struct ast_device *ast = to_ast_private(dev); 73 + struct ast_device *ast = to_ast_device(dev); 74 74 struct pci_dev *pdev = to_pci_dev(dev->dev); 75 75 u8 i, index, reg; 76 76 const u8 *ext_reg_info; ··· 273 273 274 274 static void ast_init_dram_reg(struct drm_device *dev) 275 275 { 276 - struct ast_device *ast = to_ast_private(dev); 276 + struct ast_device *ast = to_ast_device(dev); 277 277 u8 j; 278 278 u32 data, temp, i; 279 279 const struct ast_dramstruct *dram_reg_info; ··· 366 366 367 367 void ast_post_gpu(struct drm_device *dev) 368 368 { 369 - struct ast_device *ast = to_ast_private(dev); 369 + struct ast_device *ast = to_ast_device(dev); 370 370 struct pci_dev *pdev = to_pci_dev(dev->dev); 371 371 u32 reg; 372 372 ··· 1600 1600 1601 1601 static void ast_post_chip_2300(struct drm_device *dev) 1602 1602 { 1603 - struct ast_device *ast = to_ast_private(dev); 1603 + struct ast_device *ast = to_ast_device(dev); 1604 1604 struct ast2300_dram_param param; 1605 1605 u32 temp; 1606 1606 u8 reg; ··· 2066 2066 2067 2067 void ast_post_chip_2500(struct drm_device *dev) 2068 2068 { 2069 - struct ast_device *ast = to_ast_private(dev); 2069 + struct ast_device *ast = to_ast_device(dev); 2070 2070 u32 temp; 2071 2071 u8 reg; 2072 2072