drm/meson: Make use of the helper function devm_platform_ioremap_resourcexxx()
authorCai Huoqing <caihuoqing@baidu.com>
Tue, 31 Aug 2021 13:56:43 +0000 (21:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:23 +0000 (14:23 +0200)
[ Upstream commit d4cb82aa2e4bc0e46582a625cb41b64c83fdde49 ]

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

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>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210831135644.4576-1-caihuoqing@baidu.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/meson/meson_drv.c
drivers/gpu/drm/meson/meson_dw_hdmi.c

index 62846af2f5e5568c16e039efa25e3d71e2d9f27b..923377f856de554802901737dee653cb83ade094 100644 (file)
@@ -206,8 +206,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
        priv->compat = match->compat;
        priv->afbcd.ops = match->afbcd_ops;
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vpu");
-       regs = devm_ioremap_resource(dev, res);
+       regs = devm_platform_ioremap_resource_byname(pdev, "vpu");
        if (IS_ERR(regs)) {
                ret = PTR_ERR(regs);
                goto free_drm;
index 2ed87cfdd7353fc53c870834e4a93eb6b5957f69..0afbd1e70bfc39666f108828f2740a3886c14b80 100644 (file)
@@ -978,7 +978,6 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
        struct dw_hdmi_plat_data *dw_plat_data;
        struct drm_bridge *next_bridge;
        struct drm_encoder *encoder;
-       struct resource *res;
        int irq;
        int ret;
 
@@ -1042,8 +1041,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
                return PTR_ERR(meson_dw_hdmi->hdmitx_phy);
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       meson_dw_hdmi->hdmitx = devm_ioremap_resource(dev, res);
+       meson_dw_hdmi->hdmitx = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(meson_dw_hdmi->hdmitx))
                return PTR_ERR(meson_dw_hdmi->hdmitx);