drm/rockchip: Make use of the helper function devm_platform_ioremap_resource()
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: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20210831135721.4726-1-caihuoqing@baidu.com
This commit is contained in:
parent
2e87bf389e
commit
6173569810
@ -697,7 +697,6 @@ static int cdn_dp_parse_dt(struct cdn_dp_device *dp)
|
|||||||
struct device *dev = dp->dev;
|
struct device *dev = dp->dev;
|
||||||
struct device_node *np = dev->of_node;
|
struct device_node *np = dev->of_node;
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct resource *res;
|
|
||||||
|
|
||||||
dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
|
dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
|
||||||
if (IS_ERR(dp->grf)) {
|
if (IS_ERR(dp->grf)) {
|
||||||
@ -705,8 +704,7 @@ static int cdn_dp_parse_dt(struct cdn_dp_device *dp)
|
|||||||
return PTR_ERR(dp->grf);
|
return PTR_ERR(dp->grf);
|
||||||
}
|
}
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
dp->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
dp->regs = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(dp->regs)) {
|
if (IS_ERR(dp->regs)) {
|
||||||
DRM_DEV_ERROR(dev, "ioremap reg failed\n");
|
DRM_DEV_ERROR(dev, "ioremap reg failed\n");
|
||||||
return PTR_ERR(dp->regs);
|
return PTR_ERR(dp->regs);
|
||||||
|
@ -810,7 +810,6 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
|
|||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct drm_device *drm = data;
|
struct drm_device *drm = data;
|
||||||
struct inno_hdmi *hdmi;
|
struct inno_hdmi *hdmi;
|
||||||
struct resource *iores;
|
|
||||||
int irq;
|
int irq;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -821,8 +820,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,
|
|||||||
hdmi->dev = dev;
|
hdmi->dev = dev;
|
||||||
hdmi->drm_dev = drm;
|
hdmi->drm_dev = drm;
|
||||||
|
|
||||||
iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
hdmi->regs = devm_ioremap_resource(dev, iores);
|
|
||||||
if (IS_ERR(hdmi->regs))
|
if (IS_ERR(hdmi->regs))
|
||||||
return PTR_ERR(hdmi->regs);
|
return PTR_ERR(hdmi->regs);
|
||||||
|
|
||||||
|
@ -440,11 +440,9 @@ struct drm_encoder_helper_funcs px30_lvds_encoder_helper_funcs = {
|
|||||||
static int rk3288_lvds_probe(struct platform_device *pdev,
|
static int rk3288_lvds_probe(struct platform_device *pdev,
|
||||||
struct rockchip_lvds *lvds)
|
struct rockchip_lvds *lvds)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
lvds->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
lvds->regs = devm_ioremap_resource(lvds->dev, res);
|
|
||||||
if (IS_ERR(lvds->regs))
|
if (IS_ERR(lvds->regs))
|
||||||
return PTR_ERR(lvds->regs);
|
return PTR_ERR(lvds->regs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user