diff mbox series

i2s: Simplify resource retrieval and mapping by using devm_platform_get_and_ioremap_resource

Message ID 20250315102600136tIj0LVzjTQjRLKNzNwVj2@zte.com.cn (mailing list archive)
State New
Headers show
Series i2s: Simplify resource retrieval and mapping by using devm_platform_get_and_ioremap_resource | expand

Commit Message

jiang.peng9@zte.com.cn March 15, 2025, 2:26 a.m. UTC
From: Peng Jiang <jiang.peng9@zte.com.cn>

Convert platform_get_resource(), devm_ioremap_resource() to a single call
to devm_platform_get_and_ioremap_resource().

By making this change, we improve code readability and reduce redundancy
without affecting the functionality of the driver.

Signed-off-by: Peng Jiang <jiang.peng9@zte.com.cn>
---
 sound/soc/loongson/loongson_i2s_plat.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/loongson/loongson_i2s_plat.c b/sound/soc/loongson/loongson_i2s_plat.c
index fa2e450ff618..1378abca520b 100644
--- a/sound/soc/loongson/loongson_i2s_plat.c
+++ b/sound/soc/loongson/loongson_i2s_plat.c
@@ -126,8 +126,7 @@  static int loongson_i2s_plat_probe(struct platform_device *pdev)
        if (ret)
                return ret;

-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       i2s->reg_base = devm_ioremap_resource(&pdev->dev, res);
+       i2s->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(i2s->reg_base))
                return dev_err_probe(dev, PTR_ERR(i2s->reg_base),
                                     "devm_ioremap_resource failed\n");