Skip to content

Commit 2ce216e

Browse files
rmurphy-armyuq
authored andcommitted
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
1 parent 21d81f8 commit 2ce216e

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

‎drivers/gpu/drm/lima/lima_devfreq.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,12 @@ void lima_devfreq_fini(struct lima_device *ldev)
101101
}
102102

103103
if (devfreq->devfreq) {
104-
devm_devfreq_remove_device(&ldev->pdev->dev,
105-
devfreq->devfreq);
104+
devm_devfreq_remove_device(ldev->dev, devfreq->devfreq);
106105
devfreq->devfreq = NULL;
107106
}
108107

109108
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);
111110
devfreq->opp_of_table_added = false;
112111
}
113112

@@ -125,7 +124,7 @@ void lima_devfreq_fini(struct lima_device *ldev)
125124
int lima_devfreq_init(struct lima_device *ldev)
126125
{
127126
struct thermal_cooling_device *cooling;
128-
struct device *dev = &ldev->pdev->dev;
127+
struct device *dev = ldev->dev;
129128
struct opp_table *opp_table;
130129
struct devfreq *devfreq;
131130
struct lima_devfreq *ldevfreq = &ldev->devfreq;

‎drivers/gpu/drm/lima/lima_device.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ static void lima_fini_pp_pipe(struct lima_device *dev)
297297

298298
int lima_device_init(struct lima_device *ldev)
299299
{
300+
struct platform_device *pdev = to_platform_device(ldev->dev);
300301
int err, i;
301-
struct resource *res;
302302

303303
dma_set_coherent_mask(ldev->dev, DMA_BIT_MASK(32));
304304

@@ -329,8 +329,7 @@ int lima_device_init(struct lima_device *ldev)
329329
} else
330330
ldev->va_end = LIMA_VA_RESERVE_END;
331331

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);
334333
if (IS_ERR(ldev->iomem)) {
335334
dev_err(ldev->dev, "fail to ioremap iomem\n");
336335
err = PTR_ERR(ldev->iomem);

‎drivers/gpu/drm/lima/lima_device.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ enum lima_pipe_id {
7676
struct lima_device {
7777
struct device *dev;
7878
struct drm_device *ddev;
79-
struct platform_device *pdev;
8079

8180
enum lima_gpu_id id;
8281
u32 gp_version;

‎drivers/gpu/drm/lima/lima_drv.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ static int lima_pdev_probe(struct platform_device *pdev)
380380
goto err_out0;
381381
}
382382

383-
ldev->pdev = pdev;
384383
ldev->dev = &pdev->dev;
385384
ldev->id = (enum lima_gpu_id)of_device_get_match_data(&pdev->dev);
386385

0 commit comments

Comments
 (0)