Skip to content

hwmon: (oxp-sensors) Cleanup device type handling

[email protected] linux-doc linux-hwmon lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4hwmon: (oxp-sensors) Separate logic from device-specific datadrivers/hwmon/oxp-sensors.c+215 -3026 replies
2/4hwmon: (oxp-sensors) Fix typos in documentationDocumentation/hwmon/oxp-sensors.rst+1 -10 replies
3/4hwmon: (oxp-sensors) Fix wording in code commentdrivers/hwmon/oxp-sensors.c+2 -23 replies
4/4hwmon: (oxp-sensors) Cache state of PWM enable modedrivers/hwmon/oxp-sensors.c+70 -113 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] hwmon: (oxp-sensors) Cleanup device type handling

From: Tobias Jakobi <[email protected]>

Hello,

this series tries to cleanup the handling of the various device types in the oxp-sensors drivers. The current approach is error-prone since it relies on ever-growing switch-statements, which are present in multiple functions. Adding a single new device involves touching a bunch of functions.

That this is problematic is already demonstrated by this bug in the driver: While oxp_pwm_disable() handles the aya_neo_air_1s model, the inverse function oxp_pwm_enable() does not handle the model. This is obviously wrong and a result of the current design.

Introduce a different design with better separation of logic and data. While at it, also fix some typos, wording and add a cache for the PWM enable mode.

With best wishes,
Tobias

Tobias Jakobi (4):
hwmon: (oxp-sensors) Separate logic from device-specific data
hwmon: (oxp-sensors) Fix typos in documentation
hwmon: (oxp-sensors) Fix wording in code comment
hwmon: (oxp-sensors) Cache state of PWM enable mode

 Documentation/hwmon/oxp-sensors.rst |   2 +-
 drivers/hwmon/oxp-sensors.c         | 576 +++++++++++++---------------
 2 files changed, 275 insertions(+), 303 deletions(-)
Signature · 1 line
2.45.2