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

Configure Feed

Select the types of activity you want to include in your feed.

drm/sitronix/st7571-i2c: rename 'struct drm_device' in st7571_device

Rename st7571_device.dev to st7571_device.drm in preparation to
introduce a 'struct device' member to this structure.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://patch.msgid.link/20251215-st7571-split-v3-1-d5f3205c3138@gmail.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

authored by

Marcus Folkesson and committed by
Javier Martinez Canillas
c497e597 0df70ce6

+30 -30
+30 -30
drivers/gpu/drm/sitronix/st7571-i2c.c
··· 112 112 }; 113 113 114 114 struct st7571_device { 115 - struct drm_device dev; 115 + struct drm_device drm; 116 116 117 117 struct drm_plane primary_plane; 118 118 struct drm_crtc crtc; ··· 166 166 u8 *row; 167 167 }; 168 168 169 - static inline struct st7571_device *drm_to_st7571(struct drm_device *dev) 169 + static inline struct st7571_device *drm_to_st7571(struct drm_device *drm) 170 170 { 171 - return container_of(dev, struct st7571_device, dev); 171 + return container_of(drm, struct st7571_device, drm); 172 172 } 173 173 174 174 static int st7571_regmap_write(void *context, const void *data, size_t count) ··· 467 467 struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state); 468 468 struct drm_framebuffer *fb = plane_state->fb; 469 469 struct drm_atomic_helper_damage_iter iter; 470 - struct drm_device *dev = plane->dev; 470 + struct drm_device *drm = plane->dev; 471 471 struct drm_rect damage; 472 472 struct st7571_device *st7571 = drm_to_st7571(plane->dev); 473 473 int ret, idx; ··· 479 479 if (ret) 480 480 return; 481 481 482 - if (!drm_dev_enter(dev, &idx)) 482 + if (!drm_dev_enter(drm, &idx)) 483 483 goto out_drm_gem_fb_end_cpu_access; 484 484 485 485 drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state); ··· 501 501 static void st7571_primary_plane_helper_atomic_disable(struct drm_plane *plane, 502 502 struct drm_atomic_state *state) 503 503 { 504 - struct drm_device *dev = plane->dev; 504 + struct drm_device *drm = plane->dev; 505 505 struct st7571_device *st7571 = drm_to_st7571(plane->dev); 506 506 int idx; 507 507 508 - if (!drm_dev_enter(dev, &idx)) 508 + if (!drm_dev_enter(drm, &idx)) 509 509 return; 510 510 511 511 st7571_fb_clear_screen(st7571); ··· 621 621 622 622 static int st7571_mode_config_init(struct st7571_device *st7571) 623 623 { 624 - struct drm_device *dev = &st7571->dev; 624 + struct drm_device *drm = &st7571->drm; 625 625 const struct st7571_panel_constraints *constraints = &st7571->pdata->constraints; 626 626 int ret; 627 627 628 - ret = drmm_mode_config_init(dev); 628 + ret = drmm_mode_config_init(drm); 629 629 if (ret) 630 630 return ret; 631 631 632 - dev->mode_config.min_width = constraints->min_ncols; 633 - dev->mode_config.min_height = constraints->min_nlines; 634 - dev->mode_config.max_width = constraints->max_ncols; 635 - dev->mode_config.max_height = constraints->max_nlines; 636 - dev->mode_config.preferred_depth = 24; 637 - dev->mode_config.funcs = &st7571_mode_config_funcs; 632 + drm->mode_config.min_width = constraints->min_ncols; 633 + drm->mode_config.min_height = constraints->min_nlines; 634 + drm->mode_config.max_width = constraints->max_ncols; 635 + drm->mode_config.max_height = constraints->max_nlines; 636 + drm->mode_config.preferred_depth = 24; 637 + drm->mode_config.funcs = &st7571_mode_config_funcs; 638 638 639 639 return 0; 640 640 } ··· 643 643 const struct st7571_panel_format *pformat) 644 644 { 645 645 struct drm_plane *primary_plane = &st7571->primary_plane; 646 - struct drm_device *dev = &st7571->dev; 646 + struct drm_device *drm = &st7571->drm; 647 647 int ret; 648 648 649 - ret = drm_universal_plane_init(dev, primary_plane, 0, 649 + ret = drm_universal_plane_init(drm, primary_plane, 0, 650 650 &st7571_primary_plane_funcs, 651 651 pformat->formats, 652 652 pformat->nformats, ··· 665 665 { 666 666 struct drm_plane *primary_plane = &st7571->primary_plane; 667 667 struct drm_crtc *crtc = &st7571->crtc; 668 - struct drm_device *dev = &st7571->dev; 668 + struct drm_device *drm = &st7571->drm; 669 669 int ret; 670 670 671 - ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL, 671 + ret = drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL, 672 672 &st7571_crtc_funcs, NULL); 673 673 if (ret) 674 674 return ret; ··· 682 682 { 683 683 struct drm_encoder *encoder = &st7571->encoder; 684 684 struct drm_crtc *crtc = &st7571->crtc; 685 - struct drm_device *dev = &st7571->dev; 685 + struct drm_device *drm = &st7571->drm; 686 686 int ret; 687 687 688 - ret = drm_encoder_init(dev, encoder, &st7571_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL); 688 + ret = drm_encoder_init(drm, encoder, &st7571_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL); 689 689 if (ret) 690 690 return ret; 691 691 ··· 700 700 { 701 701 struct drm_connector *connector = &st7571->connector; 702 702 struct drm_encoder *encoder = &st7571->encoder; 703 - struct drm_device *dev = &st7571->dev; 703 + struct drm_device *drm = &st7571->drm; 704 704 int ret; 705 705 706 - ret = drm_connector_init(dev, connector, &st7571_connector_funcs, 706 + ret = drm_connector_init(drm, connector, &st7571_connector_funcs, 707 707 DRM_MODE_CONNECTOR_Unknown); 708 708 if (ret) 709 709 return ret; ··· 934 934 static int st7571_probe(struct i2c_client *client) 935 935 { 936 936 struct st7571_device *st7571; 937 - struct drm_device *dev; 937 + struct drm_device *drm; 938 938 int ret; 939 939 940 940 st7571 = devm_drm_dev_alloc(&client->dev, &st7571_driver, 941 - struct st7571_device, dev); 941 + struct st7571_device, drm); 942 942 if (IS_ERR(st7571)) 943 943 return PTR_ERR(st7571); 944 944 945 - dev = &st7571->dev; 945 + drm = &st7571->drm; 946 946 st7571->client = client; 947 947 i2c_set_clientdata(client, st7571); 948 948 st7571->pdata = device_get_match_data(&client->dev); ··· 1010 1010 return dev_err_probe(&client->dev, ret, 1011 1011 "Failed to initialize connector\n"); 1012 1012 1013 - drm_mode_config_reset(dev); 1013 + drm_mode_config_reset(drm); 1014 1014 1015 - ret = drm_dev_register(dev, 0); 1015 + ret = drm_dev_register(drm, 0); 1016 1016 if (ret) 1017 1017 return dev_err_probe(&client->dev, ret, 1018 1018 "Failed to register DRM device\n"); 1019 1019 1020 - drm_client_setup(dev, NULL); 1020 + drm_client_setup(drm, NULL); 1021 1021 return 0; 1022 1022 } 1023 1023 ··· 1025 1025 { 1026 1026 struct st7571_device *st7571 = i2c_get_clientdata(client); 1027 1027 1028 - drm_dev_unplug(&st7571->dev); 1028 + drm_dev_unplug(&st7571->drm); 1029 1029 } 1030 1030 1031 1031 static const struct st7571_panel_data st7567_config = {