diff mbox

[13/13] thermal: convert ti-thermal to use devm_thermal_zone_of_sensor_register

Message ID 1457559336-17652-15-git-send-email-edubezval@gmail.com (mailing list archive)
State Accepted
Delegated to: Eduardo Valentin
Headers show

Commit Message

Eduardo Valentin March 9, 2016, 9:35 p.m. UTC
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: linux-pm@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

kernel test robot March 9, 2016, 10:11 p.m. UTC | #1
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: sparc64-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=sparc64 

All error/warnings (new ones prefixed by >>):

   drivers/thermal/ti-soc-thermal/ti-thermal-common.c: In function 'ti_thermal_expose_sensor':
>> drivers/thermal/ti-soc-thermal/ti-thermal-common.c:340:2: error: implicit declaration of function 'devm_thermal_zone_of_sensor_register' [-Werror=implicit-function-declaration]
     data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
     ^
>> drivers/thermal/ti-soc-thermal/ti-thermal-common.c:340:19: warning: assignment makes pointer from integer without a cast
     data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
                      ^
   cc1: some warnings being treated as errors

vim +/devm_thermal_zone_of_sensor_register +340 drivers/thermal/ti-soc-thermal/ti-thermal-common.c

   334			data = ti_thermal_build_data(bgp, id);
   335	
   336		if (!data)
   337			return -EINVAL;
   338	
   339		/* in case this is specified by DT */
 > 340		data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
   341						data, &ti_of_thermal_ops);
   342		if (IS_ERR(data->ti_thermal)) {
   343			/* Create thermal zone */

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Keerthy March 15, 2016, 12:26 p.m. UTC | #2
Hi Eduardo,

On Thursday 10 March 2016 03:05 AM, 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.
>

Boot tested on dra7xx-evm, dra72x-evm, pandaboard-es.
Also checked the thermal sysfs entries on am57xx-beagle-x15.

Tested-by: Keerthy <j-keerthy@ti.com>


> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: linux-pm@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
> ---
>   drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> index b213a12..15c0a9a 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
> @@ -337,7 +337,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
>   		return -EINVAL;
>
>   	/* in case this is specified by DT */
> -	data->ti_thermal = thermal_zone_of_sensor_register(bgp->dev, id,
> +	data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
>   					data, &ti_of_thermal_ops);
>   	if (IS_ERR(data->ti_thermal)) {
>   		/* Create thermal zone */
> @@ -368,9 +368,6 @@ int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
>   	if (data && data->ti_thermal) {
>   		if (data->our_zone)
>   			thermal_zone_device_unregister(data->ti_thermal);
> -		else
> -			thermal_zone_of_sensor_unregister(bgp->dev,
> -							  data->ti_thermal);
>   	}
>
>   	return 0;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index b213a12..15c0a9a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -337,7 +337,7 @@  int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
 		return -EINVAL;
 
 	/* in case this is specified by DT */
-	data->ti_thermal = thermal_zone_of_sensor_register(bgp->dev, id,
+	data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
 					data, &ti_of_thermal_ops);
 	if (IS_ERR(data->ti_thermal)) {
 		/* Create thermal zone */
@@ -368,9 +368,6 @@  int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
 	if (data && data->ti_thermal) {
 		if (data->our_zone)
 			thermal_zone_device_unregister(data->ti_thermal);
-		else
-			thermal_zone_of_sensor_unregister(bgp->dev,
-							  data->ti_thermal);
 	}
 
 	return 0;