All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: linux-pm@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Marek Vasut <marek.vasut+renesas@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	David HERNANDEZ SANCHEZ <david.hernandezsanchez@st.com>,
	Eduardo Valentin <edubezval@gmail.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Zhang Rui <rui.zhang@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com
Subject: [PATCH V2 4/6] thermal: stm32: Convert to devm_thermal_zone_of_sensor_register_params()
Date: Sat, 15 Dec 2018 03:30:08 +0100	[thread overview]
Message-ID: <20181215023010.2857-5-marek.vasut+renesas@gmail.com> (raw)
In-Reply-To: <20181215023010.2857-1-marek.vasut+renesas@gmail.com>

Convert the stm32 code to devm_thermal_zone_of_sensor_register_params(),
no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: David HERNANDEZ SANCHEZ <david.hernandezsanchez@st.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
To: linux-pm@vger.kernel.org
---
V2: Rename stm_tz_ops to stm_tz_parms to avoid duplicate symbol name
---
 drivers/thermal/st/stm_thermal.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
index 47623da0f91b..827565d94c20 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -20,7 +20,6 @@
 #include <linux/thermal.h>
 
 #include "../thermal_core.h"
-#include "../thermal_hwmon.h"
 
 /* DTS register offsets */
 #define DTS_CFGR1_OFFSET	0x0
@@ -103,6 +102,10 @@ struct stm_thermal_sensor {
 	int t0, fmt0, ramp_coeff;
 };
 
+static struct thermal_zone_params stm_tz_parms = {
+	.no_hwmon	= false,
+};
+
 static irqreturn_t stm_thermal_alarm_irq(int irq, void *sdata)
 {
 	struct stm_thermal_sensor *sensor = sdata;
@@ -652,9 +655,8 @@ static int stm_thermal_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	sensor->th_dev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0,
-							      sensor,
-							      &stm_tz_ops);
+	sensor->th_dev = devm_thermal_zone_of_sensor_register_params(&pdev->dev,
+				0, sensor, &stm_tz_ops, &stm_tz_parms);
 
 	if (IS_ERR(sensor->th_dev)) {
 		dev_err(&pdev->dev, "%s: thermal zone sensor registering KO\n",
@@ -711,15 +713,6 @@ static int stm_thermal_probe(struct platform_device *pdev)
 		goto err_tz;
 	}
 
-	/*
-	 * Thermal_zone doesn't enable hwmon as default,
-	 * enable it here
-	 */
-	sensor->th_dev->tzp->no_hwmon = false;
-	ret = thermal_add_hwmon_sysfs(sensor->th_dev);
-	if (ret)
-		goto err_tz;
-
 	sensor->mode = THERMAL_DEVICE_ENABLED;
 
 	dev_info(&pdev->dev, "%s: Driver initialized successfully\n",
@@ -737,7 +730,6 @@ static int stm_thermal_remove(struct platform_device *pdev)
 	struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev);
 
 	stm_thermal_sensor_off(sensor);
-	thermal_remove_hwmon_sysfs(sensor->th_dev);
 	thermal_zone_of_sensor_unregister(&pdev->dev, sensor->th_dev);
 
 	return 0;
-- 
2.18.0


  parent reply	other threads:[~2018-12-15  2:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15  2:30 [PATCH V2 0/6] thermal: Align devm_thermal_zone_{device,of_sensor}_register Marek Vasut
2018-12-15  2:30 ` [PATCH V2 1/6] thermal: split thermal_zone_of_sensor_register{,_param}() Marek Vasut
2018-12-17 11:46   ` Simon Horman
2018-12-15  2:30 ` [PATCH V2 2/6] thermal: split devm_thermal_zone_of_sensor_register{,_param}() Marek Vasut
2018-12-17 11:47   ` Simon Horman
2018-12-15  2:30 ` [PATCH V2 3/6] thermal: Register hwmon in thermal_zone_of_sensor_register_param() Marek Vasut
2018-12-17 11:46   ` Simon Horman
2018-12-15  2:30 ` Marek Vasut [this message]
2018-12-17 11:47   ` [PATCH V2 4/6] thermal: stm32: Convert to devm_thermal_zone_of_sensor_register_params() Simon Horman
2018-12-15  2:30 ` [PATCH V2 5/6] thermal: rcar_thermal: " Marek Vasut
2018-12-17 11:45   ` Simon Horman
2018-12-15  2:30 ` [PATCH V2 6/6] thermal: rcar_gen3_thermal: Register hwmon sysfs interface Marek Vasut
2018-12-17 11:47   ` Simon Horman

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=20181215023010.2857-5-marek.vasut+renesas@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=david.hernandezsanchez@st.com \
    --cc=edubezval@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=marek.vasut+renesas@gmail.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=rui.zhang@intel.com \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.