Commit d4cb82aa authored by Cai Huoqing's avatar Cai Huoqing Committed by Neil Armstrong

drm/meson: Make use of the helper function devm_platform_ioremap_resourcexxx()

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: default avatarCai Huoqing <caihuoqing@baidu.com>
Reviewed-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210831135644.4576-1-caihuoqing@baidu.com
parent 9eeb7b4e
...@@ -206,8 +206,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) ...@@ -206,8 +206,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
priv->compat = match->compat; priv->compat = match->compat;
priv->afbcd.ops = match->afbcd_ops; priv->afbcd.ops = match->afbcd_ops;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vpu"); regs = devm_platform_ioremap_resource_byname(pdev, "vpu");
regs = devm_ioremap_resource(dev, res);
if (IS_ERR(regs)) { if (IS_ERR(regs)) {
ret = PTR_ERR(regs); ret = PTR_ERR(regs);
goto free_drm; goto free_drm;
......
...@@ -978,7 +978,6 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, ...@@ -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 dw_hdmi_plat_data *dw_plat_data;
struct drm_bridge *next_bridge; struct drm_bridge *next_bridge;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct resource *res;
int irq; int irq;
int ret; int ret;
...@@ -1042,8 +1041,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master, ...@@ -1042,8 +1041,7 @@ static int meson_dw_hdmi_bind(struct device *dev, struct device *master,
return PTR_ERR(meson_dw_hdmi->hdmitx_phy); return PTR_ERR(meson_dw_hdmi->hdmitx_phy);
} }
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); meson_dw_hdmi->hdmitx = devm_platform_ioremap_resource(pdev, 0);
meson_dw_hdmi->hdmitx = devm_ioremap_resource(dev, res);
if (IS_ERR(meson_dw_hdmi->hdmitx)) if (IS_ERR(meson_dw_hdmi->hdmitx))
return PTR_ERR(meson_dw_hdmi->hdmitx); return PTR_ERR(meson_dw_hdmi->hdmitx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment