linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call
@ 2017-07-02  0:05 Cengiz Can
  2017-07-07 18:18 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Cengiz Can @ 2017-07-02  0:05 UTC (permalink / raw)
  To: Henrik Rydberg
  Cc: Jean Delvare, Guenter Roeck, linux-hwmon, linux-kernel, Cengiz Can

Hello.

This is my first patch attempt on drivers so I might be completely wrong.

applesmc driver was using the deprecated `hwmon_device_register` call for
some reason. And that causes a deprecation warning in dmesg.

I've replaced the call with `hwmon_device_register_with_info` and booted
my MBP 11,2 with it.

The warning is no longer shown. And the functionality doesn't seem to be
broken.

Thank you for reading this.

Signed-off-by: Cengiz Can <cengizc@gmail.com>
---
 drivers/hwmon/applesmc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 0af7fd311979..6e897310151a 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -1326,7 +1326,11 @@ static int __init applesmc_init(void)
 	if (ret)
 		goto out_light_sysfs;
 
-	hwmon_dev = hwmon_device_register(&pdev->dev);
+	hwmon_dev = hwmon_device_register_with_info(&pdev->dev,
+						   "applesmcbacklight",
+						   NULL,
+						   NULL,
+						   NULL);
 	if (IS_ERR(hwmon_dev)) {
 		ret = PTR_ERR(hwmon_dev);
 		goto out_light_ledclass;
-- 
2.13.2

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

* Re: [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call
  2017-07-02  0:05 [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call Cengiz Can
@ 2017-07-07 18:18 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-07-07 18:18 UTC (permalink / raw)
  To: Cengiz Can; +Cc: Henrik Rydberg, Jean Delvare, linux-hwmon, linux-kernel

On Sun, Jul 02, 2017 at 03:05:05AM +0300, Cengiz Can wrote:
> Hello.
> 
> This is my first patch attempt on drivers so I might be completely wrong.
> 
> applesmc driver was using the deprecated `hwmon_device_register` call for
> some reason. And that causes a deprecation warning in dmesg.
> 
> I've replaced the call with `hwmon_device_register_with_info` and booted
> my MBP 11,2 with it.
> 
> The warning is no longer shown. And the functionality doesn't seem to be
> broken.
> 
> Thank you for reading this.
> 

Do you really want all of the above in the change log ?

> Signed-off-by: Cengiz Can <cengizc@gmail.com>
> ---
>  drivers/hwmon/applesmc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
> index 0af7fd311979..6e897310151a 100644
> --- a/drivers/hwmon/applesmc.c
> +++ b/drivers/hwmon/applesmc.c
> @@ -1326,7 +1326,11 @@ static int __init applesmc_init(void)
>  	if (ret)
>  		goto out_light_sysfs;
>  
> -	hwmon_dev = hwmon_device_register(&pdev->dev);
> +	hwmon_dev = hwmon_device_register_with_info(&pdev->dev,
> +						   "applesmcbacklight",
> +						   NULL,
> +						   NULL,
> +						   NULL);

I am not in favor of changes like this. It doesn't solve the problem
with the old API, which is that it maintains sysfs nodes locally.
Besides, this patch changes the name from "applesmc" to "applesmcbacklight",
it creates a name attribute in the hwmon device directory while
keeping the actual hwmon attributes in the platform device directory,
and the driver has another name attribute in the platform device directory.

Given that, sorry, I can not accept this patch.

Guenter

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

end of thread, other threads:[~2017-07-07 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-02  0:05 [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call Cengiz Can
2017-07-07 18:18 ` Guenter Roeck

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