[PATCH] drm/bridge: Use devm_platform_get_and_ioremap_resource()
oushixiong1025 at 163.com
oushixiong1025 at 163.com
Tue Jan 21 08:13:36 UTC 2025
From: Shixiong Ou <oushixiong at kylinos.cn>
Signed-off-by: Shixiong Ou <oushixiong at kylinos.cn>
---
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 +---
drivers/gpu/drm/bridge/microchip-lvds.c | 5 ++---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +--
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index bfa88409a7ff..284fd186eb5f 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1605,9 +1605,7 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
return ERR_CAST(dp->clock);
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- dp->reg_base = devm_ioremap_resource(&pdev->dev, res);
+ dp->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(dp->reg_base)) {
ret = PTR_ERR(dp->reg_base);
goto err_disable_clk;
diff --git a/drivers/gpu/drm/bridge/microchip-lvds.c b/drivers/gpu/drm/bridge/microchip-lvds.c
index b8313dad6072..a679dd76962d 100644
--- a/drivers/gpu/drm/bridge/microchip-lvds.c
+++ b/drivers/gpu/drm/bridge/microchip-lvds.c
@@ -151,6 +151,7 @@ static int mchp_lvds_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct mchp_lvds *lvds;
struct device_node *port;
+ struct resource *res;
int ret;
if (!dev->of_node)
@@ -161,9 +162,7 @@ static int mchp_lvds_probe(struct platform_device *pdev)
return -ENOMEM;
lvds->dev = dev;
-
- lvds->regs = devm_ioremap_resource(lvds->dev,
- platform_get_resource(pdev, IORESOURCE_MEM, 0));
+ lvds->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(lvds->regs))
return PTR_ERR(lvds->regs);
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 0031f3c54882..96e17776165c 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -3386,8 +3386,7 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
return ERR_PTR(-EINVAL);
}
- iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hdmi->regs = devm_ioremap_resource(dev, iores);
+ hdmi->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &iores);
if (IS_ERR(hdmi->regs)) {
ret = PTR_ERR(hdmi->regs);
goto err_res;
--
2.25.1
More information about the dri-devel
mailing list