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/lima: Clean up redundant pdev pointer

There's no point explicitly tracking the platform device when it can be
trivially derived from the regular device pointer in the couple of
places it's ever used.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8d9073cc91c10fc70910587fd1794e0e8f32b467.1587509150.git.robin.murphy@arm.com

authored by

Robin Murphy and committed by
Qiang Yu
2ce216ed 21d81f88

+5 -9
+3 -4
drivers/gpu/drm/lima/lima_devfreq.c
··· 101 101 } 102 102 103 103 if (devfreq->devfreq) { 104 - devm_devfreq_remove_device(&ldev->pdev->dev, 105 - devfreq->devfreq); 104 + devm_devfreq_remove_device(ldev->dev, devfreq->devfreq); 106 105 devfreq->devfreq = NULL; 107 106 } 108 107 109 108 if (devfreq->opp_of_table_added) { 110 - dev_pm_opp_of_remove_table(&ldev->pdev->dev); 109 + dev_pm_opp_of_remove_table(ldev->dev); 111 110 devfreq->opp_of_table_added = false; 112 111 } 113 112 ··· 124 125 int lima_devfreq_init(struct lima_device *ldev) 125 126 { 126 127 struct thermal_cooling_device *cooling; 127 - struct device *dev = &ldev->pdev->dev; 128 + struct device *dev = ldev->dev; 128 129 struct opp_table *opp_table; 129 130 struct devfreq *devfreq; 130 131 struct lima_devfreq *ldevfreq = &ldev->devfreq;
+2 -3
drivers/gpu/drm/lima/lima_device.c
··· 297 297 298 298 int lima_device_init(struct lima_device *ldev) 299 299 { 300 + struct platform_device *pdev = to_platform_device(ldev->dev); 300 301 int err, i; 301 - struct resource *res; 302 302 303 303 dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32)); 304 304 ··· 329 329 } else 330 330 ldev->va_end = LIMA_VA_RESERVE_END; 331 331 332 - res = platform_get_resource(ldev->pdev, IORESOURCE_MEM, 0); 333 - ldev->iomem = devm_ioremap_resource(ldev->dev, res); 332 + ldev->iomem = devm_platform_ioremap_resource(pdev, 0); 334 333 if (IS_ERR(ldev->iomem)) { 335 334 dev_err(ldev->dev, "fail to ioremap iomem\n"); 336 335 err = PTR_ERR(ldev->iomem);
-1
drivers/gpu/drm/lima/lima_device.h
··· 76 76 struct lima_device { 77 77 struct device *dev; 78 78 struct drm_device *ddev; 79 - struct platform_device *pdev; 80 79 81 80 enum lima_gpu_id id; 82 81 u32 gp_version;
-1
drivers/gpu/drm/lima/lima_drv.c
··· 380 380 goto err_out0; 381 381 } 382 382 383 - ldev->pdev = pdev; 384 383 ldev->dev = &pdev->dev; 385 384 ldev->id = (enum lima_gpu_id)of_device_get_match_data(&pdev->dev); 386 385