mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Amit Kucheria <amitk@kernel.org>,
	Thara Gopinath <thara.gopinath@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] thermal/drivers/qcom: Convert to devm_platform_ioremap_resource()
Date: Mon, 26 Jun 2023 20:43:30 +0800	[thread overview]
Message-ID: <20230626124334.15100-3-frank.li@vivo.com> (raw)
In-Reply-To: <20230626124334.15100-1-frank.li@vivo.com>

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.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


  parent reply	other threads:[~2023-06-26 12:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 12:43 [PATCH 1/6] drivers/thermal/k3: " Yangtao Li
2023-06-26 12:43 ` [PATCH 2/6] thermal/drivers/k3_j72xx_bandgap: " Yangtao Li
2023-06-26 12:43 ` Yangtao Li [this message]
2023-06-26 12:43 ` [PATCH 4/6] drivers/thermal/rcar_gen3_thermal: " Yangtao Li
2023-06-26 16:28   ` Niklas Söderlund
2023-06-27  2:58     ` Yangtao Li
2023-06-27  7:47       ` Niklas Söderlund
2023-06-26 12:43 ` [PATCH 5/6] thermal/drivers/rcar: " Yangtao Li
2023-06-26 16:32   ` Niklas Söderlund
2023-06-26 12:43 ` [PATCH 6/6] drivers/thermal/ti-soc-thermal: Use devm_platform_get_and_ioremap_resource() Yangtao Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230626124334.15100-3-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=agross@kernel.org \
    --cc=amitk@kernel.org \
    --cc=andersson@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=thara.gopinath@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®