drm/vc4: Make use of the helper function devm_platform_ioremap_resource()
authorCai Huoqing <caihuoqing@baidu.com>
Tue, 31 Aug 2021 13:59:03 +0000 (21:59 +0800)
committerMaxime Ripard <maxime@cerno.tech>
Wed, 1 Sep 2021 09:43:25 +0000 (11:43 +0200)
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20210831135903.4931-1-caihuoqing@baidu.com
drivers/gpu/drm/vc4/vc4_drv.c

index f6c16c5aee683617944cc57648528de40db41bdb..16abc3a3d601ba9c514c333e04065891f3d827b7 100644 (file)
 #define DRIVER_PATCHLEVEL 0
 
 /* Helper function for mapping the regs on a platform device. */
-void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index)
+void __iomem *vc4_ioremap_regs(struct platform_device *pdev, int index)
 {
-       struct resource *res;
        void __iomem *map;
 
-       res = platform_get_resource(dev, IORESOURCE_MEM, index);
-       map = devm_ioremap_resource(&dev->dev, res);
+       map = devm_platform_ioremap_resource(pdev, index);
        if (IS_ERR(map))
                return map;