From: Guenter Roeck <linux@roeck-us.net>
To: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>,
linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (acpi_power_meter) Convert to use hwmon_device_register_with_info() API
Date: Thu, 25 Jun 2020 06:45:52 -0700 [thread overview]
Message-ID: <6213bd1a-693c-9c8d-cbf1-ad0666e3c679@roeck-us.net> (raw)
In-Reply-To: <20200625073109.13993-1-misono.tomohiro@jp.fujitsu.com>
On 6/25/20 12:31 AM, Misono Tomohiro wrote:
> Since hwmon_device_register() has been deprecated and gives warning in
> dmesg, just convert it to hwmon_device_register_with_info() with name
> strings.
>
> Only difference is that now name sysfs file is created under top hwmon
> directory. i.e.:
> $ cat /sys/class/hwmon/hwmonX/name
> $ power_meter
>
> Other than that, nothing has changed.
>
> Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
> ---
> drivers/hwmon/acpi_power_meter.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c
> index a270b975e90b..d93a5423d7ae 100644
> --- a/drivers/hwmon/acpi_power_meter.c
> +++ b/drivers/hwmon/acpi_power_meter.c
> @@ -885,7 +885,8 @@ static int acpi_power_meter_add(struct acpi_device *device)
> if (res)
> goto exit_free_capability;
>
> - resource->hwmon_dev = hwmon_device_register(&device->dev);
> + resource->hwmon_dev = hwmon_device_register_with_info(&device->dev,
> + ACPI_POWER_METER_NAME, NULL, NULL, NULL);
> if (IS_ERR(resource->hwmon_dev)) {
> res = PTR_ERR(resource->hwmon_dev);
> goto exit_remove;
>
NACK
This is not acceptable and an API abuse. I'll have to make the API more restrictive
to avoid such abuse.
Guenter
prev parent reply other threads:[~2020-06-25 13:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 7:31 [PATCH] hwmon: (acpi_power_meter) Convert to use hwmon_device_register_with_info() API Misono Tomohiro
2020-06-25 13:45 ` 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=6213bd1a-693c-9c8d-cbf1-ad0666e3c679@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linux-hwmon@vger.kernel.org \
--cc=misono.tomohiro@jp.fujitsu.com \
/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;
as well as URLs for NNTP newsgroup(s).