All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
@ 2016-12-27 13:00 Fabio Estevam
  2016-12-27 15:24 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2016-12-27 13:00 UTC (permalink / raw)
  To: edubezval; +Cc: linux, linux-pm, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

Booting Linux on a mx6q based board leads to the following warning:

(NULL device *): hwmon_device_register() is deprecated. Please convert the
driver to use hwmon_device_register_with_info().

,so do as suggested.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/thermal/thermal_hwmon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
index 541af59..22397dd 100644
--- a/drivers/thermal/thermal_hwmon.c
+++ b/drivers/thermal/thermal_hwmon.c
@@ -165,7 +165,8 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
 
 	INIT_LIST_HEAD(&hwmon->tz_list);
 	strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
-	hwmon->device = hwmon_device_register(NULL);
+	hwmon->device = hwmon_device_register_with_info(NULL, NULL, NULL,
+							NULL, NULL);
 	if (IS_ERR(hwmon->device)) {
 		result = PTR_ERR(hwmon->device);
 		goto free_mem;
-- 
2.7.4


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

* Re: [RFC] thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
  2016-12-27 13:00 [RFC] thermal: thermal_hwmon: Convert to hwmon_device_register_with_info() Fabio Estevam
@ 2016-12-27 15:24 ` Guenter Roeck
  2016-12-27 16:04   ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2016-12-27 15:24 UTC (permalink / raw)
  To: Fabio Estevam, edubezval; +Cc: linux-pm, Fabio Estevam

On 12/27/2016 05:00 AM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> Booting Linux on a mx6q based board leads to the following warning:
>
> (NULL device *): hwmon_device_register() is deprecated. Please convert the
> driver to use hwmon_device_register_with_info().
>
> ,so do as suggested.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  drivers/thermal/thermal_hwmon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c
> index 541af59..22397dd 100644
> --- a/drivers/thermal/thermal_hwmon.c
> +++ b/drivers/thermal/thermal_hwmon.c
> @@ -165,7 +165,8 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
>
>  	INIT_LIST_HEAD(&hwmon->tz_list);
>  	strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH);
> -	hwmon->device = hwmon_device_register(NULL);
> +	hwmon->device = hwmon_device_register_with_info(NULL, NULL, NULL,
> +							NULL, NULL);

Interesting way of defeating the purpose ;-).

Any interest in at least trying (NULL, hwmon->type, hwmon, NULL, NULL) ?

This should result in the core taking care of creating the 'name'
attribute, so it should be possible to drop the code doing that from
the thermal driver.

Guenter

>  	if (IS_ERR(hwmon->device)) {
>  		result = PTR_ERR(hwmon->device);
>  		goto free_mem;
>


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

* Re: [RFC] thermal: thermal_hwmon: Convert to hwmon_device_register_with_info()
  2016-12-27 15:24 ` Guenter Roeck
@ 2016-12-27 16:04   ` Fabio Estevam
  0 siblings, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2016-12-27 16:04 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Eduardo Valentin, linux-pm, Fabio Estevam

On Tue, Dec 27, 2016 at 1:24 PM, Guenter Roeck <linux@roeck-us.net> wrote:

> Interesting way of defeating the purpose ;-).

Yes, that's why I marked it as RFC. Thanks for your feedback.


> Any interest in at least trying (NULL, hwmon->type, hwmon, NULL, NULL) ?

Yes, it works.

> This should result in the core taking care of creating the 'name'
> attribute, so it should be possible to drop the code doing that from
> the thermal driver.

Correct. I had to remove the device_create_file() call from the
thermal driver so that it can successfully probe.

Will resend it soon, thanks!

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

end of thread, other threads:[~2016-12-27 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-27 13:00 [RFC] thermal: thermal_hwmon: Convert to hwmon_device_register_with_info() Fabio Estevam
2016-12-27 15:24 ` Guenter Roeck
2016-12-27 16:04   ` Fabio Estevam

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.