From: Guenter Roeck <linux@roeck-us.net>
To: Cengiz Can <cengizc@gmail.com>
Cc: Henrik Rydberg <rydberg@bitmath.org>,
Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: applesmc: fix deprecated hwmon_device_register call
Date: Fri, 7 Jul 2017 11:18:28 -0700 [thread overview]
Message-ID: <20170707181828.GB25433@roeck-us.net> (raw)
In-Reply-To: <20170702000505.2650-1-cengizc@gmail.com>
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
prev parent reply other threads:[~2017-07-07 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-02 0:05 Cengiz Can
2017-07-07 18:18 ` Guenter Roeck [this message]
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=20170707181828.GB25433@roeck-us.net \
--to=linux@roeck-us.net \
--cc=cengizc@gmail.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@bitmath.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®