drm/etnaviv: Use devm_platform_ioremap_resource()
authorFabio Estevam <festevam@gmail.com>
Wed, 5 Jun 2019 17:57:02 +0000 (14:57 -0300)
committerLucas Stach <l.stach@pengutronix.de>
Fri, 2 Aug 2019 17:14:52 +0000 (19:14 +0200)
Use devm_platform_ioremap_resource() to simplify the code a bit.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c

index 6b1d7fb37c246c83e224b192c691ddc9daab4723..4ea3d12f2fd42c259093ba21a91555bb75e6f685 100644 (file)
@@ -1716,7 +1716,6 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct etnaviv_gpu *gpu;
-       struct resource *res;
        int err;
 
        gpu = devm_kzalloc(dev, sizeof(*gpu), GFP_KERNEL);
@@ -1728,8 +1727,7 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
        mutex_init(&gpu->fence_lock);
 
        /* Map registers: */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       gpu->mmio = devm_ioremap_resource(&pdev->dev, res);
+       gpu->mmio = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(gpu->mmio))
                return PTR_ERR(gpu->mmio);