[PATCH] i2s: Simplify resource retrieval and mapping by using devm_platform_get_and_ioremap_resource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



From: Peng Jiang <jiang.peng9@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 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




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux