Skip to content

Commit 72dc70a

Browse files
suijingfenglynxeye-dev
authored andcommitted
drm/etnaviv: Replace the '&pdev->dev' with 'dev'
In the etnaviv_pdev_probe() and etnaviv_gpu_platform_probe() function, the value of '&pdev->dev' has been cached to the local auto variable 'dev'. But some callers use 'dev', while the rest use '&pdev->dev'. To keep it consistent, use 'dev' uniformly. Tested-by: Christian Gmeiner <[email protected]> Signed-off-by: Sui Jingfeng <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent deadf1e commit 72dc70a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

drivers/gpu/drm/etnaviv/etnaviv_drv.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
619619
if (!of_device_is_available(core_node))
620620
continue;
621621

622-
drm_of_component_match_add(&pdev->dev, &match,
622+
drm_of_component_match_add(dev, &match,
623623
component_compare_of, core_node);
624624
}
625625
} else {
@@ -642,9 +642,9 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
642642
* bit to make sure we are allocating the command buffers and
643643
* TLBs in the lower 4 GiB address space.
644644
*/
645-
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(40)) ||
646-
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32))) {
647-
dev_dbg(&pdev->dev, "No suitable DMA available\n");
645+
if (dma_set_mask(dev, DMA_BIT_MASK(40)) ||
646+
dma_set_coherent_mask(dev, DMA_BIT_MASK(32))) {
647+
dev_dbg(dev, "No suitable DMA available\n");
648648
return -ENODEV;
649649
}
650650

@@ -655,7 +655,7 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
655655
*/
656656
first_node = etnaviv_of_first_available_node();
657657
if (first_node) {
658-
of_dma_configure(&pdev->dev, first_node, true);
658+
of_dma_configure(dev, first_node, true);
659659
of_node_put(first_node);
660660
}
661661

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,7 +1854,7 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
18541854
if (!gpu)
18551855
return -ENOMEM;
18561856

1857-
gpu->dev = &pdev->dev;
1857+
gpu->dev = dev;
18581858
mutex_init(&gpu->lock);
18591859
mutex_init(&gpu->sched_lock);
18601860

@@ -1868,8 +1868,8 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
18681868
if (gpu->irq < 0)
18691869
return gpu->irq;
18701870

1871-
err = devm_request_irq(&pdev->dev, gpu->irq, irq_handler, 0,
1872-
dev_name(gpu->dev), gpu);
1871+
err = devm_request_irq(dev, gpu->irq, irq_handler, 0,
1872+
dev_name(dev), gpu);
18731873
if (err) {
18741874
dev_err(dev, "failed to request IRQ%u: %d\n", gpu->irq, err);
18751875
return err;
@@ -1906,13 +1906,13 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
19061906
* autosuspend delay is rather arbitary: no measurements have
19071907
* yet been performed to determine an appropriate value.
19081908
*/
1909-
pm_runtime_use_autosuspend(gpu->dev);
1910-
pm_runtime_set_autosuspend_delay(gpu->dev, 200);
1911-
pm_runtime_enable(gpu->dev);
1909+
pm_runtime_use_autosuspend(dev);
1910+
pm_runtime_set_autosuspend_delay(dev, 200);
1911+
pm_runtime_enable(dev);
19121912

1913-
err = component_add(&pdev->dev, &gpu_ops);
1913+
err = component_add(dev, &gpu_ops);
19141914
if (err < 0) {
1915-
dev_err(&pdev->dev, "failed to register component: %d\n", err);
1915+
dev_err(dev, "failed to register component: %d\n", err);
19161916
return err;
19171917
}
19181918

0 commit comments

Comments
 (0)