[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250315102600136tIj0LVzjTQjRLKNzNwVj2@zte.com.cn>
Date: Sat, 15 Mar 2025 10:26:00 +0800 (CST)
From: <jiang.peng9@....com.cn>
To: <lgirdwood@...il.com>
Cc: <broonie@...nel.org>, <perex@...ex.cz>, <tiwai@...e.com>,
<jiang.peng9@....com.cn>, <zhoubinbin@...ngson.cn>,
<linux-sound@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] i2s: Simplify resource retrieval and mapping by using
devm_platform_get_and_ioremap_resource
From: Peng Jiang <jiang.peng9@....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@....com.cn>
---
sound/soc/loongson/loongson_i2s_plat.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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");
--
2.25.1
Powered by blists - more mailing lists