All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] hwmon: Introduce and use hwmon_device_register_for_thermal
@ 2022-05-11 15:12 Guenter Roeck
  2022-05-11 15:12 ` [PATCH 1/3] hwmon: Introduce hwmon_device_register_for_thermal Guenter Roeck
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Guenter Roeck @ 2022-05-11 15:12 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Daniel Lezcano, Amit Kucheria, Zhang Rui, linux-hwmon,
	linux-kernel, linux-pm, Guenter Roeck

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

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

end of thread, other threads:[~2022-05-11 19:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.