[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230626124334.15100-2-frank.li@vivo.com>
Date: Mon, 26 Jun 2023 20:43:29 +0800
From: Yangtao Li <frank.li@...o.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>
Cc: Yangtao Li <frank.li@...o.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/6] thermal/drivers/k3_j72xx_bandgap: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@...o.com>
---
drivers/thermal/k3_j72xx_bandgap.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
index 5be1f09eeb2c..6c82b92d86fd 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -346,7 +346,6 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
{
int ret = 0, cnt, val, id;
int high_max, low_temp;
- struct resource *res;
struct device *dev = &pdev->dev;
struct k3_j72xx_bandgap *bgp;
struct k3_thermal_data *data;
@@ -376,13 +375,11 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
return -ENOMEM;
bgp->dev = dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- bgp->base = devm_ioremap_resource(dev, res);
+ bgp->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(bgp->base))
return PTR_ERR(bgp->base);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- bgp->cfg2_base = devm_ioremap_resource(dev, res);
+ bgp->cfg2_base = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(bgp->cfg2_base))
return PTR_ERR(bgp->cfg2_base);
@@ -400,8 +397,7 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
* https://www.ti.com/lit/er/sprz455c/sprz455c.pdf
*/
if (workaround_needed) {
- res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
- fuse_base = devm_ioremap_resource(dev, res);
+ fuse_base = devm_platform_ioremap_resource(pdev, 2);
if (IS_ERR(fuse_base))
return PTR_ERR(fuse_base);
--
2.39.0
Powered by blists - more mailing lists