All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	linux-hwmon@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 0/3] hwmon: Introduce and use hwmon_device_register_for_thermal
Date: Wed, 11 May 2022 12:21:19 -0700	[thread overview]
Message-ID: <637ed1af-8914-96b5-3a3f-04db94d16b38@roeck-us.net> (raw)
In-Reply-To: <CAJZ5v0gk19uQG-+_gm7J_Gk+H2mtH+SmEojnPcEDiFdPoyjCzw@mail.gmail.com>

On 5/11/22 11:21, Rafael J. Wysocki wrote:
> On Wed, May 11, 2022 at 5:12 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> The thermal subsystem registers a hwmon driver without providing
>> chip information or sysfs group information. This is for legacy reasons
>> and would be difficult to change.
>>
>> At the same time, several attempts have been made to convert hwmon
>> drivers using the deprecated hwmon_device_register() to use
>> hwmon_device_register_with_info() by just providing NULL parameters.
>> This is an abuse of the hwmon API. To prevent this abuse, we want to
>> enforce that a parent device pointer as well as chip information is
>> provided when registering a hwmon device using
>> hwmon_device_register_with_info().
>>
>> To be able to do this, introduce and use a special API for use only by
>> the thermal subsystem (patches 1 and 2). Patch 3 makes the 'dev' and 'chip'
>> parameters of hwmon_device_register_with_info() mandatory.
>>
>> ----------------------------------------------------------------
>> Guenter Roeck (3):
>>        hwmon: Introduce hwmon_device_register_for_thermal
>>        thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal()
>>        hwmon: Make chip parameter for with_info API mandatory
>>
>>   Documentation/hwmon/hwmon-kernel-api.rst |  2 +-
>>   drivers/hwmon/hwmon.c                    | 41 ++++++++++++++++++++++++++++++++---------
>>   drivers/thermal/thermal_hwmon.c          |  6 ++++--
>>   include/linux/hwmon.h                    |  3 +++
>>   4 files changed, 40 insertions(+), 12 deletions(-)
> 
> This looks good to me from the thermal perspective, so please feel
> free to add my ACKs to the first two patches.
> 

Thanks!

Guenter


      reply	other threads:[~2022-05-11 19:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-11 15:12 [PATCH 0/3] hwmon: Introduce and use hwmon_device_register_for_thermal Guenter Roeck
2022-05-11 15:12 ` [PATCH 1/3] hwmon: Introduce hwmon_device_register_for_thermal Guenter Roeck
2022-05-11 15:12 ` [PATCH 2/3] thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal() Guenter Roeck
2022-05-11 15:12 ` [PATCH 3/3] hwmon: Make chip parameter for with_info API mandatory Guenter Roeck
2022-05-11 18:21 ` [PATCH 0/3] hwmon: Introduce and use hwmon_device_register_for_thermal Rafael J. Wysocki
2022-05-11 19:21   ` 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=637ed1af-8914-96b5-3a3f-04db94d16b38@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=amitk@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.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 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.