linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RESEND] thermal: qcom-spmi: Treat reg property as a single cell
@ 2016-10-18 23:40 Stephen Boyd
  2016-10-24 19:27 ` Andy Gross
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Boyd @ 2016-10-18 23:40 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin
  Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, linux-pm,
	Ivan T . Ivanov

We only read the first element of the reg property to figure out
the offset of the temperature sensor inside the PMIC.
Furthermore, we want to remove the second element in DT, so just
don't read the second element so that probe keeps working if we
change the DT in the future.

Cc: Ivan T. Ivanov <iivanov.xz@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This was sent in January of this year but hasn't been picked up.

 drivers/thermal/qcom-spmi-temp-alarm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom-spmi-temp-alarm.c
index 819c6d5d7aa7..f50241962ad2 100644
--- a/drivers/thermal/qcom-spmi-temp-alarm.c
+++ b/drivers/thermal/qcom-spmi-temp-alarm.c
@@ -200,7 +200,7 @@ static int qpnp_tm_probe(struct platform_device *pdev)
 	struct qpnp_tm_chip *chip;
 	struct device_node *node;
 	u8 type, subtype;
-	u32 res[2];
+	u32 res;
 	int ret, irq;
 
 	node = pdev->dev.of_node;
@@ -215,7 +215,7 @@ static int qpnp_tm_probe(struct platform_device *pdev)
 	if (!chip->map)
 		return -ENXIO;
 
-	ret = of_property_read_u32_array(node, "reg", res, 2);
+	ret = of_property_read_u32(node, "reg", &res);
 	if (ret < 0)
 		return ret;
 
@@ -228,7 +228,7 @@ static int qpnp_tm_probe(struct platform_device *pdev)
 	if (PTR_ERR(chip->adc) == -EPROBE_DEFER)
 		return PTR_ERR(chip->adc);
 
-	chip->base = res[0];
+	chip->base = res;
 
 	ret = qpnp_tm_read(chip, QPNP_TM_REG_TYPE, &type);
 	if (ret < 0) {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH/RESEND] thermal: qcom-spmi: Treat reg property as a single cell
  2016-10-18 23:40 [PATCH/RESEND] thermal: qcom-spmi: Treat reg property as a single cell Stephen Boyd
@ 2016-10-24 19:27 ` Andy Gross
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Gross @ 2016-10-24 19:27 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Zhang Rui, Eduardo Valentin, linux-kernel, linux-arm-msm,
	linux-arm-kernel, linux-pm, Ivan T . Ivanov

On Tue, Oct 18, 2016 at 04:40:19PM -0700, Stephen Boyd wrote:
> We only read the first element of the reg property to figure out
> the offset of the temperature sensor inside the PMIC.
> Furthermore, we want to remove the second element in DT, so just
> don't read the second element so that probe keeps working if we
> change the DT in the future.
> 
> Cc: Ivan T. Ivanov <iivanov.xz@gmail.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Reviewed-by: Andy Gross <andy.gross@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-24 19:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-18 23:40 [PATCH/RESEND] thermal: qcom-spmi: Treat reg property as a single cell Stephen Boyd
2016-10-24 19:27 ` Andy Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).