[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230626124334.15100-3-frank.li@vivo.com>
Date: Mon, 26 Jun 2023 20:43:30 +0800
From: Yangtao Li <frank.li@...o.com>
To: Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Amit Kucheria <amitk@...nel.org>,
Thara Gopinath <thara.gopinath@...il.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Zhang Rui <rui.zhang@...el.com>
Cc: Yangtao Li <frank.li@...o.com>, linux-pm@...r.kernel.org,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/6] thermal/drivers/qcom: 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/qcom/tsens.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 98c356acfe98..f2e67adcf4ee 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -890,7 +890,6 @@ int __init init_common(struct tsens_priv *priv)
void __iomem *tm_base, *srot_base;
struct device *dev = priv->dev;
u32 ver_minor;
- struct resource *res;
u32 enabled;
int ret, i, j;
struct platform_device *op = of_find_device_by_node(priv->dev->of_node);
@@ -901,8 +900,7 @@ int __init init_common(struct tsens_priv *priv)
if (op->num_resources > 1) {
/* DT with separate SROT and TM address space */
priv->tm_offset = 0;
- res = platform_get_resource(op, IORESOURCE_MEM, 1);
- srot_base = devm_ioremap_resource(dev, res);
+ srot_base = devm_platform_ioremap_resource(op, 1);
if (IS_ERR(srot_base)) {
ret = PTR_ERR(srot_base);
goto err_put_device;
@@ -920,8 +918,7 @@ int __init init_common(struct tsens_priv *priv)
}
if (tsens_version(priv) >= VER_0_1) {
- res = platform_get_resource(op, IORESOURCE_MEM, 0);
- tm_base = devm_ioremap_resource(dev, res);
+ tm_base = devm_platform_ioremap_resource(op, 0);
if (IS_ERR(tm_base)) {
ret = PTR_ERR(tm_base);
goto err_put_device;
--
2.39.0
Powered by blists - more mailing lists