linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register
       [not found] <1457559336-17652-1-git-send-email-edubezval@gmail.com>
@ 2016-03-09 21:35 ` Eduardo Valentin
  2016-03-09 21:45   ` Dmitry Torokhov
  2016-03-10  9:34   ` Sascha Hauer
  2016-03-09 21:35 ` [PATCH 07/13] thermal: convert mtk_thermal " Eduardo Valentin
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Eduardo Valentin @ 2016-03-09 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

This changes the driver to use the devm_ version
of thermal_zone_of_sensor_register and cleans
up the  local points and unregister calls.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jens Thiele <karme@karme.de>
Cc: linux-input at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
 drivers/input/touchscreen/sun4i-ts.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index 4857943..d07dd29 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -115,7 +115,6 @@
 struct sun4i_ts_data {
 	struct device *dev;
 	struct input_dev *input;
-	struct thermal_zone_device *tz;
 	void __iomem *base;
 	unsigned int irq;
 	bool ignore_fifo_data;
@@ -366,10 +365,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
 	if (IS_ERR(hwmon))
 		return PTR_ERR(hwmon);
 
-	ts->tz = thermal_zone_of_sensor_register(ts->dev, 0, ts,
-						 &sun4i_ts_tz_ops);
-	if (IS_ERR(ts->tz))
-		ts->tz = NULL;
+	devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);
 
 	writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
 
@@ -377,7 +373,6 @@ static int sun4i_ts_probe(struct platform_device *pdev)
 		error = input_register_device(ts->input);
 		if (error) {
 			writel(0, ts->base + TP_INT_FIFOC);
-			thermal_zone_of_sensor_unregister(ts->dev, ts->tz);
 			return error;
 		}
 	}
@@ -394,8 +389,6 @@ static int sun4i_ts_remove(struct platform_device *pdev)
 	if (ts->input)
 		input_unregister_device(ts->input);
 
-	thermal_zone_of_sensor_unregister(ts->dev, ts->tz);
-
 	/* Deactivate all IRQs */
 	writel(0, ts->base + TP_INT_FIFOC);
 
-- 
2.1.4

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

* [PATCH 07/13] thermal: convert mtk_thermal to use devm_thermal_zone_of_sensor_register
       [not found] <1457559336-17652-1-git-send-email-edubezval@gmail.com>
  2016-03-09 21:35 ` [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register Eduardo Valentin
@ 2016-03-09 21:35 ` Eduardo Valentin
  2016-03-09 23:18   ` kbuild test robot
  2016-03-09 21:35 ` [PATCH 10/13] thermal: convert rockchip_thermal " Eduardo Valentin
  2016-03-09 21:35 ` [PATCH 11/13] thermal: convert exynos " Eduardo Valentin
  3 siblings, 1 reply; 14+ messages in thread
From: Eduardo Valentin @ 2016-03-09 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

This changes the driver to use the devm_ version
of thermal_zone_of_sensor_register and cleans
up the  local points and unregister calls.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-mediatek at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
 drivers/thermal/mtk_thermal.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
index 3d93b1c..2c40b0f 100644
--- a/drivers/thermal/mtk_thermal.c
+++ b/drivers/thermal/mtk_thermal.c
@@ -145,7 +145,6 @@ struct mtk_thermal {
 	s32 o_slope;
 	s32 vts[MT8173_NUM_SENSORS];
 
-	struct thermal_zone_device *tzd;
 };
 
 struct mtk_thermal_bank_cfg {
@@ -573,16 +572,11 @@ static int mtk_thermal_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, mt);
 
-	mt->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
-				&mtk_thermal_ops);
-	if (IS_ERR(mt->tzd))
-		goto err_register;
+	devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
+					     &mtk_thermal_ops);
 
 	return 0;
 
-err_register:
-	clk_disable_unprepare(mt->clk_peri_therm);
-
 err_disable_clk_auxadc:
 	clk_disable_unprepare(mt->clk_auxadc);
 
@@ -593,8 +587,6 @@ static int mtk_thermal_remove(struct platform_device *pdev)
 {
 	struct mtk_thermal *mt = platform_get_drvdata(pdev);
 
-	thermal_zone_of_sensor_unregister(&pdev->dev, mt->tzd);
-
 	clk_disable_unprepare(mt->clk_peri_therm);
 	clk_disable_unprepare(mt->clk_auxadc);
 
-- 
2.1.4

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

* [PATCH 10/13] thermal: convert rockchip_thermal to use devm_thermal_zone_of_sensor_register
       [not found] <1457559336-17652-1-git-send-email-edubezval@gmail.com>
  2016-03-09 21:35 ` [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register Eduardo Valentin
  2016-03-09 21:35 ` [PATCH 07/13] thermal: convert mtk_thermal " Eduardo Valentin
@ 2016-03-09 21:35 ` Eduardo Valentin
  2016-03-09 22:23   ` Heiko Stübner
  2016-03-10  2:36   ` Caesar Wang
  2016-03-09 21:35 ` [PATCH 11/13] thermal: convert exynos " Eduardo Valentin
  3 siblings, 2 replies; 14+ messages in thread
From: Eduardo Valentin @ 2016-03-09 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

This changes the driver to use the devm_ version
of thermal_zone_of_sensor_register and cleans
up the  local points and unregister calls.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-pm at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-rockchip at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
 drivers/thermal/rockchip_thermal.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index b58e3fb..792c5d0 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -753,8 +753,8 @@ rockchip_thermal_register_sensor(struct platform_device *pdev,
 
 	sensor->thermal = thermal;
 	sensor->id = id;
-	sensor->tzd = thermal_zone_of_sensor_register(&pdev->dev, id, sensor,
-						      &rockchip_of_thermal_ops);
+	sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id,
+					sensor, &rockchip_of_thermal_ops);
 	if (IS_ERR(sensor->tzd)) {
 		error = PTR_ERR(sensor->tzd);
 		dev_err(&pdev->dev, "failed to register sensor %d: %d\n",
@@ -782,7 +782,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 	const struct of_device_id *match;
 	struct resource *res;
 	int irq;
-	int i, j;
+	int i;
 	int error;
 
 	match = of_match_node(of_rockchip_thermal_match, np);
@@ -865,9 +865,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev,
 				"failed to register sensor[%d] : error = %d\n",
 				i, error);
-			for (j = 0; j < i; j++)
-				thermal_zone_of_sensor_unregister(&pdev->dev,
-						thermal->sensors[j].tzd);
 			goto err_disable_pclk;
 		}
 	}
@@ -879,7 +876,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 	if (error) {
 		dev_err(&pdev->dev,
 			"failed to request tsadc irq: %d\n", error);
-		goto err_unregister_sensor;
+		goto err_disable_pclk;
 	}
 
 	thermal->chip->control(thermal->regs, true);
@@ -891,11 +888,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_unregister_sensor:
-	while (i--)
-		thermal_zone_of_sensor_unregister(&pdev->dev,
-						  thermal->sensors[i].tzd);
-
 err_disable_pclk:
 	clk_disable_unprepare(thermal->pclk);
 err_disable_clk:
@@ -913,7 +905,6 @@ static int rockchip_thermal_remove(struct platform_device *pdev)
 		struct rockchip_thermal_sensor *sensor = &thermal->sensors[i];
 
 		rockchip_thermal_toggle_sensor(sensor, false);
-		thermal_zone_of_sensor_unregister(&pdev->dev, sensor->tzd);
 	}
 
 	thermal->chip->control(thermal->regs, false);
-- 
2.1.4

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

* [PATCH 11/13] thermal: convert exynos to use devm_thermal_zone_of_sensor_register
       [not found] <1457559336-17652-1-git-send-email-edubezval@gmail.com>
                   ` (2 preceding siblings ...)
  2016-03-09 21:35 ` [PATCH 10/13] thermal: convert rockchip_thermal " Eduardo Valentin
@ 2016-03-09 21:35 ` Eduardo Valentin
  2016-03-10  0:16   ` Krzysztof Kozlowski
  2016-03-10  9:16   ` Lukasz Majewski
  3 siblings, 2 replies; 14+ messages in thread
From: Eduardo Valentin @ 2016-03-09 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

This changes the driver to use the devm_ version
of thermal_zone_of_sensor_register and cleans
up the  local points and unregister calls.

Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-pm at vger.kernel.org
Cc: linux-samsung-soc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
 drivers/thermal/samsung/exynos_tmu.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index fa61eff..256039e 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1363,8 +1363,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 	 * data->tzd must be registered before calling exynos_tmu_initialize(),
 	 * requesting irq and calling exynos_tmu_control().
 	 */
-	data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, data,
-						    &exynos_sensor_ops);
+	data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, data,
+							 &exynos_sensor_ops);
 	if (IS_ERR(data->tzd)) {
 		ret = PTR_ERR(data->tzd);
 		dev_err(&pdev->dev, "Failed to register sensor: %d\n", ret);
@@ -1374,21 +1374,19 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 	ret = exynos_tmu_initialize(pdev);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to initialize TMU\n");
-		goto err_thermal;
+		goto err_sclk;
 	}
 
 	ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq,
 		IRQF_TRIGGER_RISING | IRQF_SHARED, dev_name(&pdev->dev), data);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq);
-		goto err_thermal;
+		goto err_sclk;
 	}
 
 	exynos_tmu_control(pdev, true);
 	return 0;
 
-err_thermal:
-	thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd);
 err_sclk:
 	clk_disable_unprepare(data->sclk);
 err_clk:
@@ -1406,9 +1404,7 @@ err_sensor:
 static int exynos_tmu_remove(struct platform_device *pdev)
 {
 	struct exynos_tmu_data *data = platform_get_drvdata(pdev);
-	struct thermal_zone_device *tzd = data->tzd;
 
-	thermal_zone_of_sensor_unregister(&pdev->dev, tzd);
 	exynos_tmu_control(pdev, false);
 
 	clk_disable_unprepare(data->sclk);
-- 
2.1.4

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

* [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register Eduardo Valentin
@ 2016-03-09 21:45   ` Dmitry Torokhov
  2016-03-14 21:07     ` Eduardo Valentin
  2016-03-10  9:34   ` Sascha Hauer
  1 sibling, 1 reply; 14+ messages in thread
From: Dmitry Torokhov @ 2016-03-09 21:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 09, 2016 at 01:35:27PM -0800, Eduardo Valentin wrote:
> This changes the driver to use the devm_ version
> of thermal_zone_of_sensor_register and cleans
> up the  local points and unregister calls.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Jens Thiele <karme@karme.de>
> Cc: linux-input at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

I guess it will make sense to merge through your tree unless you want to
hold off until after I merge winth mainline (around -rc3) assuming that
it even makes into 4.6.

Thanks.

> ---
>  drivers/input/touchscreen/sun4i-ts.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
> index 4857943..d07dd29 100644
> --- a/drivers/input/touchscreen/sun4i-ts.c
> +++ b/drivers/input/touchscreen/sun4i-ts.c
> @@ -115,7 +115,6 @@
>  struct sun4i_ts_data {
>  	struct device *dev;
>  	struct input_dev *input;
> -	struct thermal_zone_device *tz;
>  	void __iomem *base;
>  	unsigned int irq;
>  	bool ignore_fifo_data;
> @@ -366,10 +365,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  	if (IS_ERR(hwmon))
>  		return PTR_ERR(hwmon);
>  
> -	ts->tz = thermal_zone_of_sensor_register(ts->dev, 0, ts,
> -						 &sun4i_ts_tz_ops);
> -	if (IS_ERR(ts->tz))
> -		ts->tz = NULL;
> +	devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);
>  
>  	writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
>  
> @@ -377,7 +373,6 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  		error = input_register_device(ts->input);
>  		if (error) {
>  			writel(0, ts->base + TP_INT_FIFOC);
> -			thermal_zone_of_sensor_unregister(ts->dev, ts->tz);
>  			return error;
>  		}
>  	}
> @@ -394,8 +389,6 @@ static int sun4i_ts_remove(struct platform_device *pdev)
>  	if (ts->input)
>  		input_unregister_device(ts->input);
>  
> -	thermal_zone_of_sensor_unregister(ts->dev, ts->tz);
> -
>  	/* Deactivate all IRQs */
>  	writel(0, ts->base + TP_INT_FIFOC);
>  
> -- 
> 2.1.4
> 

-- 
Dmitry

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

* [PATCH 10/13] thermal: convert rockchip_thermal to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 10/13] thermal: convert rockchip_thermal " Eduardo Valentin
@ 2016-03-09 22:23   ` Heiko Stübner
  2016-03-10  2:36   ` Caesar Wang
  1 sibling, 0 replies; 14+ messages in thread
From: Heiko Stübner @ 2016-03-09 22:23 UTC (permalink / raw)
  To: linux-arm-kernel

Am Mittwoch, 9. M?rz 2016, 13:35:32 schrieb Eduardo Valentin:
> This changes the driver to use the devm_ version
> of thermal_zone_of_sensor_register and cleans
> up the  local points and unregister calls.
> 
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-rockchip at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

to me this looks ok
Reviewed-by: Heiko Stuebner <heiko@sntech.de>

I've also added in some Rockchip people that were working on the driver in the 
past.


Heiko

> ---
>  drivers/thermal/rockchip_thermal.c | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/thermal/rockchip_thermal.c
> b/drivers/thermal/rockchip_thermal.c index b58e3fb..792c5d0 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -753,8 +753,8 @@ rockchip_thermal_register_sensor(struct platform_device
> *pdev,
> 
>  	sensor->thermal = thermal;
>  	sensor->id = id;
> -	sensor->tzd = thermal_zone_of_sensor_register(&pdev->dev, id, sensor,
> -						      &rockchip_of_thermal_ops);
> +	sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id,
> +					sensor, &rockchip_of_thermal_ops);
>  	if (IS_ERR(sensor->tzd)) {
>  		error = PTR_ERR(sensor->tzd);
>  		dev_err(&pdev->dev, "failed to register sensor %d: %d\n",
> @@ -782,7 +782,7 @@ static int rockchip_thermal_probe(struct platform_device
> *pdev) const struct of_device_id *match;
>  	struct resource *res;
>  	int irq;
> -	int i, j;
> +	int i;
>  	int error;
> 
>  	match = of_match_node(of_rockchip_thermal_match, np);
> @@ -865,9 +865,6 @@ static int rockchip_thermal_probe(struct platform_device
> *pdev) dev_err(&pdev->dev,
>  				"failed to register sensor[%d] : error = %d\n",
>  				i, error);
> -			for (j = 0; j < i; j++)
> -				thermal_zone_of_sensor_unregister(&pdev->dev,
> -						thermal->sensors[j].tzd);
>  			goto err_disable_pclk;
>  		}
>  	}
> @@ -879,7 +876,7 @@ static int rockchip_thermal_probe(struct platform_device
> *pdev) if (error) {
>  		dev_err(&pdev->dev,
>  			"failed to request tsadc irq: %d\n", error);
> -		goto err_unregister_sensor;
> +		goto err_disable_pclk;
>  	}
> 
>  	thermal->chip->control(thermal->regs, true);
> @@ -891,11 +888,6 @@ static int rockchip_thermal_probe(struct
> platform_device *pdev)
> 
>  	return 0;
> 
> -err_unregister_sensor:
> -	while (i--)
> -		thermal_zone_of_sensor_unregister(&pdev->dev,
> -						  thermal->sensors[i].tzd);
> -
>  err_disable_pclk:
>  	clk_disable_unprepare(thermal->pclk);
>  err_disable_clk:
> @@ -913,7 +905,6 @@ static int rockchip_thermal_remove(struct
> platform_device *pdev) struct rockchip_thermal_sensor *sensor =
> &thermal->sensors[i];
> 
>  		rockchip_thermal_toggle_sensor(sensor, false);
> -		thermal_zone_of_sensor_unregister(&pdev->dev, sensor->tzd);
>  	}
> 
>  	thermal->chip->control(thermal->regs, false);

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

* [PATCH 07/13] thermal: convert mtk_thermal to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 07/13] thermal: convert mtk_thermal " Eduardo Valentin
@ 2016-03-09 23:18   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2016-03-09 23:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eduardo,

[auto build test ERROR on soc-thermal/next]
[also build test ERROR on next-20160309]
[cannot apply to thermal/next v4.5-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Eduardo-Valentin/thermal-convert-users-of-thermal_zone_of_sensor_register-to-devm_/20160310-054318
base:   https://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal next
config: parisc-allyesconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=parisc 

All errors (new ones prefixed by >>):

   drivers/thermal/mtk_thermal.c: In function 'mtk_thermal_probe':
>> drivers/thermal/mtk_thermal.c:575:2: error: implicit declaration of function 'devm_thermal_zone_of_sensor_register' [-Werror=implicit-function-declaration]
     devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
     ^
   cc1: some warnings being treated as errors

vim +/devm_thermal_zone_of_sensor_register +575 drivers/thermal/mtk_thermal.c

   569		for (i = 0; i < MT8173_NUM_ZONES; i++)
   570			mtk_thermal_init_bank(mt, i, apmixed_phys_base,
   571					      auxadc_phys_base);
   572	
   573		platform_set_drvdata(pdev, mt);
   574	
 > 575		devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
   576						     &mtk_thermal_ops);
   577	
   578		return 0;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 43726 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160310/c73f7ba9/attachment-0001.obj>

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

* [PATCH 11/13] thermal: convert exynos to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 11/13] thermal: convert exynos " Eduardo Valentin
@ 2016-03-10  0:16   ` Krzysztof Kozlowski
  2016-03-14 19:48     ` Eduardo Valentin
  2016-03-10  9:16   ` Lukasz Majewski
  1 sibling, 1 reply; 14+ messages in thread
From: Krzysztof Kozlowski @ 2016-03-10  0:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 10.03.2016 06:35, Eduardo Valentin wrote:
> This changes the driver to use the devm_ version
> of thermal_zone_of_sensor_register and cleans
> up the  local points and unregister calls.
> 
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-samsung-soc at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> ---
>  drivers/thermal/samsung/exynos_tmu.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index fa61eff..256039e 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -1363,8 +1363,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  	 * data->tzd must be registered before calling exynos_tmu_initialize(),
>  	 * requesting irq and calling exynos_tmu_control().
>  	 */
> -	data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, data,
> -						    &exynos_sensor_ops);
> +	data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, data,
> +							 &exynos_sensor_ops);
>  	if (IS_ERR(data->tzd)) {
>  		ret = PTR_ERR(data->tzd);
>  		dev_err(&pdev->dev, "Failed to register sensor: %d\n", ret);
> @@ -1374,21 +1374,19 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  	ret = exynos_tmu_initialize(pdev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to initialize TMU\n");
> -		goto err_thermal;
> +		goto err_sclk;
>  	}
>  
>  	ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq,
>  		IRQF_TRIGGER_RISING | IRQF_SHARED, dev_name(&pdev->dev), data);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq);
> -		goto err_thermal;
> +		goto err_sclk;
>  	}
>  
>  	exynos_tmu_control(pdev, true);
>  	return 0;
>  
> -err_thermal:
> -	thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd);
>  err_sclk:
>  	clk_disable_unprepare(data->sclk);
>  err_clk:
> @@ -1406,9 +1404,7 @@ err_sensor:
>  static int exynos_tmu_remove(struct platform_device *pdev)
>  {
>  	struct exynos_tmu_data *data = platform_get_drvdata(pdev);
> -	struct thermal_zone_device *tzd = data->tzd;
>  
> -	thermal_zone_of_sensor_unregister(&pdev->dev, tzd);

Before, the sensor was removed from zone (ops like get_temp NULL-ified
etc), then we stopped TMU, disabled clocks, disabled regulator and
finally freed IRQ (through devm-like interface).

Now this will be different - first stop of TMU, disable clocks, disable,
regulator, remove sensor from zone (through devm) and finally free IRQ.

Are you sure that changing order is okay?

Best regards,
Krzysztof

>  	exynos_tmu_control(pdev, false);
>  
>  	clk_disable_unprepare(data->sclk);
> 

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

* [PATCH 10/13] thermal: convert rockchip_thermal to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 10/13] thermal: convert rockchip_thermal " Eduardo Valentin
  2016-03-09 22:23   ` Heiko Stübner
@ 2016-03-10  2:36   ` Caesar Wang
  1 sibling, 0 replies; 14+ messages in thread
From: Caesar Wang @ 2016-03-10  2:36 UTC (permalink / raw)
  To: linux-arm-kernel



? 2016?03?10? 05:35, Eduardo Valentin ??:
> This changes the driver to use the devm_ version
> of thermal_zone_of_sensor_register and cleans
> up the  local points and unregister calls.
>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-rockchip at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

Tested-by: Caesar Wang <wxt@rock-chips.com>
Reviewed-by: Caesar Wang <wxt@rock-chips.com>

I just cherry-pick the devm* patches to test the rockchip thermal.

> ---
>   drivers/thermal/rockchip_thermal.c | 17 ++++-------------
>   1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
> index b58e3fb..792c5d0 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -753,8 +753,8 @@ rockchip_thermal_register_sensor(struct platform_device *pdev,
>   
>   	sensor->thermal = thermal;
>   	sensor->id = id;
> -	sensor->tzd = thermal_zone_of_sensor_register(&pdev->dev, id, sensor,
> -						      &rockchip_of_thermal_ops);
> +	sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, id,
> +					sensor, &rockchip_of_thermal_ops);
>   	if (IS_ERR(sensor->tzd)) {
>   		error = PTR_ERR(sensor->tzd);
>   		dev_err(&pdev->dev, "failed to register sensor %d: %d\n",
> @@ -782,7 +782,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>   	const struct of_device_id *match;
>   	struct resource *res;
>   	int irq;
> -	int i, j;
> +	int i;
>   	int error;
>   
>   	match = of_match_node(of_rockchip_thermal_match, np);
> @@ -865,9 +865,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>   			dev_err(&pdev->dev,
>   				"failed to register sensor[%d] : error = %d\n",
>   				i, error);
> -			for (j = 0; j < i; j++)
> -				thermal_zone_of_sensor_unregister(&pdev->dev,
> -						thermal->sensors[j].tzd);
>   			goto err_disable_pclk;
>   		}
>   	}
> @@ -879,7 +876,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>   	if (error) {
>   		dev_err(&pdev->dev,
>   			"failed to request tsadc irq: %d\n", error);
> -		goto err_unregister_sensor;
> +		goto err_disable_pclk;
>   	}
>   
>   	thermal->chip->control(thermal->regs, true);
> @@ -891,11 +888,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
>   
>   	return 0;
>   
> -err_unregister_sensor:
> -	while (i--)
> -		thermal_zone_of_sensor_unregister(&pdev->dev,
> -						  thermal->sensors[i].tzd);
> -
>   err_disable_pclk:
>   	clk_disable_unprepare(thermal->pclk);
>   err_disable_clk:
> @@ -913,7 +905,6 @@ static int rockchip_thermal_remove(struct platform_device *pdev)
>   		struct rockchip_thermal_sensor *sensor = &thermal->sensors[i];
>   
>   		rockchip_thermal_toggle_sensor(sensor, false);
> -		thermal_zone_of_sensor_unregister(&pdev->dev, sensor->tzd);
>   	}
>   
>   	thermal->chip->control(thermal->regs, false);


-- 
Thanks,
Caesar

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

* [PATCH 11/13] thermal: convert exynos to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 11/13] thermal: convert exynos " Eduardo Valentin
  2016-03-10  0:16   ` Krzysztof Kozlowski
@ 2016-03-10  9:16   ` Lukasz Majewski
  1 sibling, 0 replies; 14+ messages in thread
From: Lukasz Majewski @ 2016-03-10  9:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eduardo,

> This changes the driver to use the devm_ version
> of thermal_zone_of_sensor_register and cleans
> up the  local points and unregister calls.
> 
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Kukjin Kim <kgene@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Cc: linux-pm at vger.kernel.org
> Cc: linux-samsung-soc at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> ---
>  drivers/thermal/samsung/exynos_tmu.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c
> b/drivers/thermal/samsung/exynos_tmu.c index fa61eff..256039e 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -1363,8 +1363,8 @@ static int exynos_tmu_probe(struct
> platform_device *pdev)
>  	 * data->tzd must be registered before calling
> exynos_tmu_initialize(),
>  	 * requesting irq and calling exynos_tmu_control().
>  	 */
> -	data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0,
> data,
> -
> &exynos_sensor_ops);
> +	data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev,
> 0, data,
> +
> &exynos_sensor_ops); if (IS_ERR(data->tzd)) {
>  		ret = PTR_ERR(data->tzd);
>  		dev_err(&pdev->dev, "Failed to register sensor:
> %d\n", ret); @@ -1374,21 +1374,19 @@ static int
> exynos_tmu_probe(struct platform_device *pdev) ret =
> exynos_tmu_initialize(pdev); if (ret) {
>  		dev_err(&pdev->dev, "Failed to initialize TMU\n");
> -		goto err_thermal;
> +		goto err_sclk;
>  	}
>  
>  	ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq,
>  		IRQF_TRIGGER_RISING | IRQF_SHARED,
> dev_name(&pdev->dev), data); if (ret) {
>  		dev_err(&pdev->dev, "Failed to request irq: %d\n",
> data->irq);
> -		goto err_thermal;
> +		goto err_sclk;
>  	}
>  
>  	exynos_tmu_control(pdev, true);
>  	return 0;
>  
> -err_thermal:
> -	thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd);
>  err_sclk:
>  	clk_disable_unprepare(data->sclk);
>  err_clk:
> @@ -1406,9 +1404,7 @@ err_sensor:
>  static int exynos_tmu_remove(struct platform_device *pdev)
>  {
>  	struct exynos_tmu_data *data = platform_get_drvdata(pdev);
> -	struct thermal_zone_device *tzd = data->tzd;
>  
> -	thermal_zone_of_sensor_unregister(&pdev->dev, tzd);
>  	exynos_tmu_control(pdev, false);
>  
>  	clk_disable_unprepare(data->sclk);

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

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

* [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:35 ` [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register Eduardo Valentin
  2016-03-09 21:45   ` Dmitry Torokhov
@ 2016-03-10  9:34   ` Sascha Hauer
  2016-03-10 13:19     ` Hans de Goede
  1 sibling, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2016-03-10  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 09, 2016 at 01:35:27PM -0800, Eduardo Valentin wrote:
> This changes the driver to use the devm_ version
> of thermal_zone_of_sensor_register and cleans
> up the  local points and unregister calls.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Chen-Yu Tsai <wens@csie.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Jens Thiele <karme@karme.de>
> Cc: linux-input at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> ---
>  drivers/input/touchscreen/sun4i-ts.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
> index 4857943..d07dd29 100644
> --- a/drivers/input/touchscreen/sun4i-ts.c
> +++ b/drivers/input/touchscreen/sun4i-ts.c
> @@ -115,7 +115,6 @@
>  struct sun4i_ts_data {
>  	struct device *dev;
>  	struct input_dev *input;
> -	struct thermal_zone_device *tz;
>  	void __iomem *base;
>  	unsigned int irq;
>  	bool ignore_fifo_data;
> @@ -366,10 +365,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>  	if (IS_ERR(hwmon))
>  		return PTR_ERR(hwmon);
>  
> -	ts->tz = thermal_zone_of_sensor_register(ts->dev, 0, ts,
> -						 &sun4i_ts_tz_ops);
> -	if (IS_ERR(ts->tz))
> -		ts->tz = NULL;
> +	devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);

Shouldn't we check the return value? There are a few possibilities for
thermal_zone_of_sensor_register to fail.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register
  2016-03-10  9:34   ` Sascha Hauer
@ 2016-03-10 13:19     ` Hans de Goede
  0 siblings, 0 replies; 14+ messages in thread
From: Hans de Goede @ 2016-03-10 13:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 10-03-16 10:34, Sascha Hauer wrote:
> On Wed, Mar 09, 2016 at 01:35:27PM -0800, Eduardo Valentin wrote:
>> This changes the driver to use the devm_ version
>> of thermal_zone_of_sensor_register and cleans
>> up the  local points and unregister calls.
>>
>> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
>> Cc: Chen-Yu Tsai <wens@csie.org>
>> Cc: Hans de Goede <hdegoede@redhat.com>
>> Cc: Zhang Rui <rui.zhang@intel.com>
>> Cc: Lukasz Majewski <l.majewski@samsung.com>
>> Cc: Heiko Stuebner <heiko@sntech.de>
>> Cc: Sascha Hauer <s.hauer@pengutronix.de>
>> Cc: Jens Thiele <karme@karme.de>
>> Cc: linux-input at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-kernel at vger.kernel.org
>> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
>> ---
>>   drivers/input/touchscreen/sun4i-ts.c | 9 +--------
>>   1 file changed, 1 insertion(+), 8 deletions(-)
>>
>> diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
>> index 4857943..d07dd29 100644
>> --- a/drivers/input/touchscreen/sun4i-ts.c
>> +++ b/drivers/input/touchscreen/sun4i-ts.c
>> @@ -115,7 +115,6 @@
>>   struct sun4i_ts_data {
>>   	struct device *dev;
>>   	struct input_dev *input;
>> -	struct thermal_zone_device *tz;
>>   	void __iomem *base;
>>   	unsigned int irq;
>>   	bool ignore_fifo_data;
>> @@ -366,10 +365,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
>>   	if (IS_ERR(hwmon))
>>   		return PTR_ERR(hwmon);
>>
>> -	ts->tz = thermal_zone_of_sensor_register(ts->dev, 0, ts,
>> -						 &sun4i_ts_tz_ops);
>> -	if (IS_ERR(ts->tz))
>> -		ts->tz = NULL;
>> +	devm_thermal_zone_of_sensor_register(ts->dev, 0, ts, &sun4i_ts_tz_ops);
>
> Shouldn't we check the return value? There are a few possibilities for
> thermal_zone_of_sensor_register to fail.

Note thee old code also was not checking this, it was simply continuing
without having registered a tz-sensor.

I guess we could log an error in that case, but that should be done in a
seperate follow-up patch.

The current patch looks good to me:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

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

* [PATCH 11/13] thermal: convert exynos to use devm_thermal_zone_of_sensor_register
  2016-03-10  0:16   ` Krzysztof Kozlowski
@ 2016-03-14 19:48     ` Eduardo Valentin
  0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2016-03-14 19:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 10, 2016 at 09:16:36AM +0900, Krzysztof Kozlowski wrote:
> On 10.03.2016 06:35, Eduardo Valentin wrote:
> > This changes the driver to use the devm_ version
> > of thermal_zone_of_sensor_register and cleans
> > up the  local points and unregister calls.
> > 
> > Cc: Lukasz Majewski <l.majewski@samsung.com>
> > Cc: Zhang Rui <rui.zhang@intel.com>
> > Cc: Kukjin Kim <kgene@kernel.org>
> > Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> > Cc: linux-pm at vger.kernel.org
> > Cc: linux-samsung-soc at vger.kernel.org
> > Cc: linux-arm-kernel at lists.infradead.org
> > Cc: linux-kernel at vger.kernel.org
> > Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c | 12 ++++--------
> >  1 file changed, 4 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> > index fa61eff..256039e 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -1363,8 +1363,8 @@ static int exynos_tmu_probe(struct platform_device *pdev)
> >  	 * data->tzd must be registered before calling exynos_tmu_initialize(),
> >  	 * requesting irq and calling exynos_tmu_control().
> >  	 */
> > -	data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, data,
> > -						    &exynos_sensor_ops);
> > +	data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, data,
> > +							 &exynos_sensor_ops);
> >  	if (IS_ERR(data->tzd)) {
> >  		ret = PTR_ERR(data->tzd);
> >  		dev_err(&pdev->dev, "Failed to register sensor: %d\n", ret);
> > @@ -1374,21 +1374,19 @@ static int exynos_tmu_probe(struct platform_device *pdev)
> >  	ret = exynos_tmu_initialize(pdev);
> >  	if (ret) {
> >  		dev_err(&pdev->dev, "Failed to initialize TMU\n");
> > -		goto err_thermal;
> > +		goto err_sclk;
> >  	}
> >  
> >  	ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq,
> >  		IRQF_TRIGGER_RISING | IRQF_SHARED, dev_name(&pdev->dev), data);
> >  	if (ret) {
> >  		dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq);
> > -		goto err_thermal;
> > +		goto err_sclk;
> >  	}
> >  
> >  	exynos_tmu_control(pdev, true);
> >  	return 0;
> >  
> > -err_thermal:
> > -	thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd);
> >  err_sclk:
> >  	clk_disable_unprepare(data->sclk);
> >  err_clk:
> > @@ -1406,9 +1404,7 @@ err_sensor:
> >  static int exynos_tmu_remove(struct platform_device *pdev)
> >  {
> >  	struct exynos_tmu_data *data = platform_get_drvdata(pdev);
> > -	struct thermal_zone_device *tzd = data->tzd;
> >  
> > -	thermal_zone_of_sensor_unregister(&pdev->dev, tzd);
> 
> Before, the sensor was removed from zone (ops like get_temp NULL-ified
> etc), then we stopped TMU, disabled clocks, disabled regulator and
> finally freed IRQ (through devm-like interface).
> 
> Now this will be different - first stop of TMU, disable clocks, disable,
> regulator, remove sensor from zone (through devm) and finally free IRQ.
> 
> Are you sure that changing order is okay?

Not really. After checking the driver code and your suggestions, I don't
think this driver would benefit of this change, not at least the way it
is currently.

Thanks for pointing out. I am taking this driver out of the series.


> 
> Best regards,
> Krzysztof
> 
> >  	exynos_tmu_control(pdev, false);
> >  
> >  	clk_disable_unprepare(data->sclk);
> > 
> 

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

* [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register
  2016-03-09 21:45   ` Dmitry Torokhov
@ 2016-03-14 21:07     ` Eduardo Valentin
  0 siblings, 0 replies; 14+ messages in thread
From: Eduardo Valentin @ 2016-03-14 21:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Mar 09, 2016 at 01:45:14PM -0800, Dmitry Torokhov wrote:
> On Wed, Mar 09, 2016 at 01:35:27PM -0800, Eduardo Valentin wrote:
> > This changes the driver to use the devm_ version
> > of thermal_zone_of_sensor_register and cleans
> > up the  local points and unregister calls.
> > 
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> > Cc: Chen-Yu Tsai <wens@csie.org>
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Cc: Zhang Rui <rui.zhang@intel.com>
> > Cc: Lukasz Majewski <l.majewski@samsung.com>
> > Cc: Heiko Stuebner <heiko@sntech.de>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > Cc: Jens Thiele <karme@karme.de>
> > Cc: linux-input at vger.kernel.org
> > Cc: linux-arm-kernel at lists.infradead.org
> > Cc: linux-kernel at vger.kernel.org
> > Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> I guess it will make sense to merge through your tree unless you want to
> hold off until after I merge winth mainline (around -rc3) assuming that
> it even makes into 4.6.

No rush from my side. I would rather get the right review cycles.

The devm_ APIs were sent to 4.6-rc1 (well, right now in Rui's tree, but
I assume he is sending them).

Thanks for your review.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160314/49ac3d45/attachment.sig>

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

end of thread, other threads:[~2016-03-14 21:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1457559336-17652-1-git-send-email-edubezval@gmail.com>
2016-03-09 21:35 ` [PATCH 05/13] input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register Eduardo Valentin
2016-03-09 21:45   ` Dmitry Torokhov
2016-03-14 21:07     ` Eduardo Valentin
2016-03-10  9:34   ` Sascha Hauer
2016-03-10 13:19     ` Hans de Goede
2016-03-09 21:35 ` [PATCH 07/13] thermal: convert mtk_thermal " Eduardo Valentin
2016-03-09 23:18   ` kbuild test robot
2016-03-09 21:35 ` [PATCH 10/13] thermal: convert rockchip_thermal " Eduardo Valentin
2016-03-09 22:23   ` Heiko Stübner
2016-03-10  2:36   ` Caesar Wang
2016-03-09 21:35 ` [PATCH 11/13] thermal: convert exynos " Eduardo Valentin
2016-03-10  0:16   ` Krzysztof Kozlowski
2016-03-14 19:48     ` Eduardo Valentin
2016-03-10  9:16   ` Lukasz Majewski

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).