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/arm/malidp: replace drm->dev_private with drm_to_malidp()

Using drm_device->dev_private is deprecated. Since we've switched to
devm_drm_dev_alloc(), struct drm_device is now embedded in struct
malidp_drm, hence we can use container_of() to get the struct drm_device
instance instead.

Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221026155934.125294-3-dakr@redhat.com

authored by

Danilo Krummrich and committed by
Liviu Dudau
1b93d3cb aefae871

+25 -27
+1 -1
drivers/gpu/drm/arm/malidp_crtc.c
··· 526 526 527 527 int malidp_crtc_init(struct drm_device *drm) 528 528 { 529 - struct malidp_drm *malidp = drm->dev_private; 529 + struct malidp_drm *malidp = drm_to_malidp(drm); 530 530 struct drm_plane *primary = NULL, *plane; 531 531 int ret; 532 532
+13 -16
drivers/gpu/drm/arm/malidp_drv.c
··· 169 169 */ 170 170 static int malidp_set_and_wait_config_valid(struct drm_device *drm) 171 171 { 172 - struct malidp_drm *malidp = drm->dev_private; 172 + struct malidp_drm *malidp = drm_to_malidp(drm); 173 173 struct malidp_hw_device *hwdev = malidp->dev; 174 174 int ret; 175 175 ··· 190 190 static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state) 191 191 { 192 192 struct drm_device *drm = state->dev; 193 - struct malidp_drm *malidp = drm->dev_private; 193 + struct malidp_drm *malidp = drm_to_malidp(drm); 194 194 int loop = 5; 195 195 196 196 malidp->event = malidp->crtc.state->event; ··· 231 231 static void malidp_atomic_commit_tail(struct drm_atomic_state *state) 232 232 { 233 233 struct drm_device *drm = state->dev; 234 - struct malidp_drm *malidp = drm->dev_private; 234 + struct malidp_drm *malidp = drm_to_malidp(drm); 235 235 struct drm_crtc *crtc; 236 236 struct drm_crtc_state *old_crtc_state; 237 237 int i; ··· 393 393 static int malidp_init(struct drm_device *drm) 394 394 { 395 395 int ret; 396 - struct malidp_drm *malidp = drm->dev_private; 396 + struct malidp_drm *malidp = drm_to_malidp(drm); 397 397 struct malidp_hw_device *hwdev = malidp->dev; 398 398 399 399 drm_mode_config_init(drm); ··· 429 429 { 430 430 int irq_de, irq_se, ret = 0; 431 431 struct drm_device *drm = dev_get_drvdata(&pdev->dev); 432 - struct malidp_drm *malidp = drm->dev_private; 432 + struct malidp_drm *malidp = drm_to_malidp(drm); 433 433 struct malidp_hw_device *hwdev = malidp->dev; 434 434 435 435 /* fetch the interrupts from DT */ ··· 463 463 struct drm_device *drm, 464 464 struct drm_mode_create_dumb *args) 465 465 { 466 - struct malidp_drm *malidp = drm->dev_private; 466 + struct malidp_drm *malidp = drm_to_malidp(drm); 467 467 /* allocate for the worst case scenario, i.e. rotated buffers */ 468 468 u8 alignment = malidp_hw_get_pitch_align(malidp->dev, 1); 469 469 ··· 509 509 static int malidp_show_stats(struct seq_file *m, void *arg) 510 510 { 511 511 struct drm_device *drm = m->private; 512 - struct malidp_drm *malidp = drm->dev_private; 512 + struct malidp_drm *malidp = drm_to_malidp(drm); 513 513 unsigned long irqflags; 514 514 struct malidp_error_stats de_errors, se_errors; 515 515 ··· 532 532 { 533 533 struct seq_file *m = file->private_data; 534 534 struct drm_device *drm = m->private; 535 - struct malidp_drm *malidp = drm->dev_private; 535 + struct malidp_drm *malidp = drm_to_malidp(drm); 536 536 unsigned long irqflags; 537 537 538 538 spin_lock_irqsave(&malidp->errors_lock, irqflags); ··· 553 553 554 554 static void malidp_debugfs_init(struct drm_minor *minor) 555 555 { 556 - struct malidp_drm *malidp = minor->dev->dev_private; 556 + struct malidp_drm *malidp = drm_to_malidp(minor->dev); 557 557 558 558 malidp_error_stats_init(&malidp->de_errors); 559 559 malidp_error_stats_init(&malidp->se_errors); ··· 653 653 char *buf) 654 654 { 655 655 struct drm_device *drm = dev_get_drvdata(dev); 656 - struct malidp_drm *malidp = drm->dev_private; 656 + struct malidp_drm *malidp = drm_to_malidp(drm); 657 657 658 658 return snprintf(buf, PAGE_SIZE, "%08x\n", malidp->core_id); 659 659 } ··· 671 671 static int malidp_runtime_pm_suspend(struct device *dev) 672 672 { 673 673 struct drm_device *drm = dev_get_drvdata(dev); 674 - struct malidp_drm *malidp = drm->dev_private; 674 + struct malidp_drm *malidp = drm_to_malidp(drm); 675 675 struct malidp_hw_device *hwdev = malidp->dev; 676 676 677 677 /* we can only suspend if the hardware is in config mode */ ··· 690 690 static int malidp_runtime_pm_resume(struct device *dev) 691 691 { 692 692 struct drm_device *drm = dev_get_drvdata(dev); 693 - struct malidp_drm *malidp = drm->dev_private; 693 + struct malidp_drm *malidp = drm_to_malidp(drm); 694 694 struct malidp_hw_device *hwdev = malidp->dev; 695 695 696 696 clk_prepare_enable(hwdev->pclk); ··· 756 756 if (ret && ret != -ENODEV) 757 757 return ret; 758 758 759 - drm->dev_private = malidp; 760 759 dev_set_drvdata(dev, drm); 761 760 762 761 /* Enable power management */ ··· 881 882 pm_runtime_disable(dev); 882 883 else 883 884 malidp_runtime_pm_suspend(dev); 884 - drm->dev_private = NULL; 885 885 dev_set_drvdata(dev, NULL); 886 886 of_reserved_mem_device_release(dev); 887 887 ··· 890 892 static void malidp_unbind(struct device *dev) 891 893 { 892 894 struct drm_device *drm = dev_get_drvdata(dev); 893 - struct malidp_drm *malidp = drm->dev_private; 895 + struct malidp_drm *malidp = drm_to_malidp(drm); 894 896 struct malidp_hw_device *hwdev = malidp->dev; 895 897 896 898 drm_dev_unregister(drm); ··· 908 910 pm_runtime_disable(dev); 909 911 else 910 912 malidp_runtime_pm_suspend(dev); 911 - drm->dev_private = NULL; 912 913 dev_set_drvdata(dev, NULL); 913 914 of_reserved_mem_device_release(dev); 914 915 }
+1
drivers/gpu/drm/arm/malidp_drv.h
··· 45 45 #endif 46 46 }; 47 47 48 + #define drm_to_malidp(x) container_of(x, struct malidp_drm, base) 48 49 #define crtc_to_malidp_device(x) container_of(x, struct malidp_drm, crtc) 49 50 50 51 struct malidp_plane {
+5 -5
drivers/gpu/drm/arm/malidp_hw.c
··· 1168 1168 static irqreturn_t malidp_de_irq(int irq, void *arg) 1169 1169 { 1170 1170 struct drm_device *drm = arg; 1171 - struct malidp_drm *malidp = drm->dev_private; 1171 + struct malidp_drm *malidp = drm_to_malidp(drm); 1172 1172 struct malidp_hw_device *hwdev; 1173 1173 struct malidp_hw *hw; 1174 1174 const struct malidp_irq_map *de; ··· 1226 1226 static irqreturn_t malidp_de_irq_thread_handler(int irq, void *arg) 1227 1227 { 1228 1228 struct drm_device *drm = arg; 1229 - struct malidp_drm *malidp = drm->dev_private; 1229 + struct malidp_drm *malidp = drm_to_malidp(drm); 1230 1230 1231 1231 wake_up(&malidp->wq); 1232 1232 ··· 1252 1252 1253 1253 int malidp_de_irq_init(struct drm_device *drm, int irq) 1254 1254 { 1255 - struct malidp_drm *malidp = drm->dev_private; 1255 + struct malidp_drm *malidp = drm_to_malidp(drm); 1256 1256 struct malidp_hw_device *hwdev = malidp->dev; 1257 1257 int ret; 1258 1258 ··· 1286 1286 static irqreturn_t malidp_se_irq(int irq, void *arg) 1287 1287 { 1288 1288 struct drm_device *drm = arg; 1289 - struct malidp_drm *malidp = drm->dev_private; 1289 + struct malidp_drm *malidp = drm_to_malidp(drm); 1290 1290 struct malidp_hw_device *hwdev = malidp->dev; 1291 1291 struct malidp_hw *hw = hwdev->hw; 1292 1292 const struct malidp_irq_map *se = &hw->map.se_irq_map; ··· 1363 1363 1364 1364 int malidp_se_irq_init(struct drm_device *drm, int irq) 1365 1365 { 1366 - struct malidp_drm *malidp = drm->dev_private; 1366 + struct malidp_drm *malidp = drm_to_malidp(drm); 1367 1367 struct malidp_hw_device *hwdev = malidp->dev; 1368 1368 int ret; 1369 1369
+3 -3
drivers/gpu/drm/arm/malidp_mw.c
··· 129 129 struct drm_connector_state *conn_state) 130 130 { 131 131 struct malidp_mw_connector_state *mw_state = to_mw_state(conn_state); 132 - struct malidp_drm *malidp = encoder->dev->dev_private; 132 + struct malidp_drm *malidp = drm_to_malidp(encoder->dev); 133 133 struct drm_framebuffer *fb; 134 134 int i, n_planes; 135 135 ··· 207 207 208 208 int malidp_mw_connector_init(struct drm_device *drm) 209 209 { 210 - struct malidp_drm *malidp = drm->dev_private; 210 + struct malidp_drm *malidp = drm_to_malidp(drm); 211 211 u32 *formats; 212 212 int ret, n_formats; 213 213 ··· 236 236 void malidp_mw_atomic_commit(struct drm_device *drm, 237 237 struct drm_atomic_state *old_state) 238 238 { 239 - struct malidp_drm *malidp = drm->dev_private; 239 + struct malidp_drm *malidp = drm_to_malidp(drm); 240 240 struct drm_writeback_connector *mw_conn = &malidp->mw_connector; 241 241 struct drm_connector_state *conn_state = mw_conn->base.state; 242 242 struct malidp_hw_device *hwdev = malidp->dev;
+2 -2
drivers/gpu/drm/arm/malidp_planes.c
··· 151 151 { 152 152 const struct drm_format_info *info; 153 153 const u64 *modifiers; 154 - struct malidp_drm *malidp = drm->dev_private; 154 + struct malidp_drm *malidp = drm_to_malidp(drm); 155 155 const struct malidp_hw_regmap *map = &malidp->dev->hw->map; 156 156 157 157 if (WARN_ON(modifier == DRM_FORMAT_MOD_INVALID)) ··· 931 931 932 932 int malidp_de_planes_init(struct drm_device *drm) 933 933 { 934 - struct malidp_drm *malidp = drm->dev_private; 934 + struct malidp_drm *malidp = drm_to_malidp(drm); 935 935 const struct malidp_hw_regmap *map = &malidp->dev->hw->map; 936 936 struct malidp_plane *plane = NULL; 937 937 enum drm_plane_type plane_type;