diff mbox series

drm/bridge: analogix_dp: Use devm_platform_get_and_ioremap_resource() in analogix_dp_probe()

Message ID 9a813af3-78d4-406e-8b52-8c5f9fb38ab9@web.de (mailing list archive)
State New, archived
Headers show
Series drm/bridge: analogix_dp: Use devm_platform_get_and_ioremap_resource() in analogix_dp_probe() | expand

Commit Message

Markus Elfring Feb. 5, 2024, 7:43 a.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 5 Feb 2024 08:30:57 +0100

A wrapper function is available since the commit 890cc39a879906b63912482dfc41944579df2dc6
("drivers: provide devm_platform_get_and_ioremap_resource()").
Thus reuse existing functionality instead of keeping duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--
2.43.0
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index df9370e0ff23..1c7dbf1ced77 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1739,10 +1739,7 @@  analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)
 	}

 	clk_prepare_enable(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;