Skip to content

HID: iio: basic clean up and introduce devm_ API for HID sensors

Sanjay Chitroda linux-iio linux-input lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest36 patches 8 repliesIn review

Changes in v4 from the cover letter

- Extend the series to cover remaining HID IIO drivers with devm API usage
- Reorder patches to place cleanup and warning fix at beginning and, devm-related changes toward the end based on feedback from David
- v3 series -> https://lore.kernel.org/all/[email protected]/

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/36iio: hid-sensors: add missing blank line after declarationsdrivers/iio/common/hid-sensors/hid-sensor-trigger.c+3 -00 replies
2/36iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigneddrivers/iio/gyro/hid-sensor-gyro-3d.c+3 -31 reply
3/36iio: accel: hid-sensor-accel-3d: use u32 instead of unsigneddrivers/iio/accel/hid-sensor-accel-3d.c+3 -30 replies
4/36iio: light: hid-sensor-als: use u32 instead of unsigneddrivers/iio/light/hid-sensor-als.c+3 -30 replies
5/36iio: light: hid-sensor-prox: use u32 instead of unsigneddrivers/iio/light/hid-sensor-prox.c+2 -20 replies
6/36iio: orientation: hid-sensor-incl-3d: use u32 instead of unsigneddrivers/iio/orientation/hid-sensor-incl-3d.c+3 -30 replies
7/36iio: orientation: hid-sensor-rotation: use u32 instead of unsigneddrivers/iio/orientation/hid-sensor-rotation.c+3 -30 replies
8/36iio: pressure: hid-sensor-press: use u32 instead of unsigneddrivers/iio/pressure/hid-sensor-press.c+3 -30 replies
9/36iio: humidity: hid-sensor-humidity: align parenthesis for readabilitydrivers/iio/humidity/hid-sensor-humidity.c+23 -230 replies
10/36iio: gyro: hid-sensor-gyro-3d: align parenthesis for readabilitydrivers/iio/gyro/hid-sensor-gyro-3d.c+34 -330 replies
11/36iio: magnetometer: hid-sensor-magn-3d: align parenthesis for readabilitydrivers/iio/magnetometer/hid-sensor-magn-3d.c+36 -360 replies
12/36iio: humidity: hid-sensor-humidity: use common device for devresdrivers/iio/humidity/hid-sensor-humidity.c+1 -10 replies
13/36iio: position: hid-sensor-custom-intel-hinge: use common device for devresdrivers/iio/position/hid-sensor-custom-intel-hinge.c+1 -10 replies
14/36iio: temperature: hid-sensor-temperature: use common device for devresdrivers/iio/temperature/hid-sensor-temperature.c+2 -20 replies
15/36iio: humidity: hid-sensor-humidity: use local struct devicedrivers/iio/humidity/hid-sensor-humidity.c+4 -30 replies
16/36iio: gyro: hid-sensor-gyro-3d: use local struct devicedrivers/iio/gyro/hid-sensor-gyro-3d.c+10 -90 replies
17/36iio: accel: hid-sensor-accel-3d: use local struct devicedrivers/iio/accel/hid-sensor-accel-3d.c+10 -100 replies
18/36iio: light: hid-sensor-als: use local struct devicedrivers/iio/light/hid-sensor-als.c+8 -70 replies
19/36iio: light: hid-sensor-prox: use local struct devicedrivers/iio/light/hid-sensor-prox.c+8 -80 replies
20/36iio: magnetometer: hid-sensor-magn-3d: use local struct devicedrivers/iio/magnetometer/hid-sensor-magn-3d.c+19 -170 replies
21/36iio: orientation: hid-sensor-incl-3d: use local struct devicedrivers/iio/orientation/hid-sensor-incl-3d.c+10 -100 replies
22/36iio: orientation: hid-sensor-rotation: use local struct devicedrivers/iio/orientation/hid-sensor-rotation.c+11 -110 replies
23/36iio: position: hid-sensor-custom-intel-hinge: use local struct devicedrivers/iio/position/hid-sensor-custom-intel-hinge.c+9 -80 replies
24/36iio: pressure: hid-sensor-press: use local struct devicedrivers/iio/pressure/hid-sensor-press.c+10 -100 replies
25/36iio: hid-sensors: remove unused iio_dev argumentdrivers/iio/accel/hid-sensor-accel-3d.c drivers/iio/common/hid-sensors/hid-sensor-trigger.c drivers/iio/common/hid-sensors/hid-sensor-trigger.h +10 more+24 -260 replies
26/36iio: hid-sensors: introduce device managed APIdrivers/iio/common/hid-sensors/hid-sensor-trigger.c drivers/iio/common/hid-sensors/hid-sensor-trigger.h+20 -00 replies
27/36iio: gyro: hid-sensor-gyro-3d: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/gyro/hid-sensor-gyro-3d.c+3 -70 replies
28/36iio: humidity: hid-sensor-humidity: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/humidity/hid-sensor-humidity.c+3 -70 replies
29/36iio: light: hid-sensor-prox: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/light/hid-sensor-prox.c+3 -70 replies
30/36iio: light: hid-sensor-als: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/light/hid-sensor-als.c+3 -70 replies
31/36iio: magnetometer: hid-sensor-magn-3d: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/magnetometer/hid-sensor-magn-3d.c+3 -70 replies
32/36iio: orientation: hid-sensor-incl-3d: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/orientation/hid-sensor-incl-3d.c+3 -70 replies
33/36iio: orientation: hid-sensor-rotation: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/orientation/hid-sensor-rotation.c+3 -70 replies
34/36iio: position: hid-sensor-custom-intel-hinge: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/position/hid-sensor-custom-intel-hinge.c+3 -70 replies
35/36iio: pressure: hid-sensor-press: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/pressure/hid-sensor-press.c+3 -74 replies
36/36iio: temperature: hid-sensor-temperature: drop hid_sensor_remove_trigger() using devm APIdrivers/iio/temperature/hid-sensor-temperature.c+3 -80 replies

Reviews trailers per patch

1 of 36 patches has a Reviewed-by or Acked-by.

PatchZhang LixuSrinivas Pandruvada
1/36
2/36
3/36
4/36
5/36
6/36
7/36
8/36
9/36
10/36
11/36
12/36T-b
13/36
14/36
15/36
16/36
17/36
18/36
19/36
20/36
21/36
22/36
23/36
24/36
25/36T-b A-b
26/36T-b
27/36T-b
28/36T-b
29/36
30/36
31/36
32/36
33/36
34/36
35/36
36/36

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors

From: Sanjay Chitroda <[email protected]>

Key highlights:
- 0000-0024: General cleanup and kernel few coding style fixes across HID IIO drivers
- 0025: Remove unused iio_dev argument from HID IIO sensor helper
- 0026: Introduce devm_hid_sensor_setup_trigger() device-managed API
- 0027-0036: Convert HID IIO sensor drivers to use the new devm-based trigger setup

changes in v4:
- Extend the series to cover remaining HID IIO drivers with devm API usage
- Reorder patches to place cleanup and warning fix at beginning and, devm-related changes toward the end based on feedback from David
- v3 series -> https://lore.kernel.org/all/[email protected]/
changes in v3:
- Added cleanup and prepratory changes before adding devm_ API
conversion based on self review: 0002, 0004, 0006, 0007 and 0008
- Address andy's review comment on commit message and coding style
- v2 series -> https://lore.kernel.org/all/[email protected]/
changes in v2:
- Following input from Jonathan and Andy, squash initial patch v1
series in single change as individual change should not break anything
- Add devm API support and two driver using the same
- v1 series -> https://lore.kernel.org/all/[email protected]/

Testing:
- Compiled with W=1 for each patch in series
- Build-tested on QEMU x86_64

P.S.
- Sashiko reported an issue in a different driver and noted that it is not introduced by this series. I have taken this feedback into account and will address the actual issue in a separate series focus on that driver.
- Once this series is merged into the IIO tree, a number of HID IIO drivers will become available to fully converted to devm API usage.
- The changes are organized across drivers to keep similar modifications grouped together for consistency, making the series easier to review, rather than grouping all changes per driver.

Thanks,
Sanjay Chitroda

Sanjay Chitroda (36):
iio: hid-sensors: add missing blank line after declarations
iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigned
iio: accel: hid-sensor-accel-3d: use u32 instead of unsigned
iio: light: hid-sensor-als: use u32 instead of unsigned
iio: light: hid-sensor-prox: use u32 instead of unsigned
iio: orientation: hid-sensor-incl-3d: use u32 instead of unsigned
iio: orientation: hid-sensor-rotation: use u32 instead of unsigned
iio: pressure: hid-sensor-press: use u32 instead of unsigned
iio: humidity: hid-sensor-humidity: align parenthesis for readability
iio: gyro: hid-sensor-gyro-3d: align parenthesis for readability
iio: magnetometer: hid-sensor-magn-3d: align parenthesis for
readability
iio: humidity: hid-sensor-humidity: use common device for devres
iio: position: hid-sensor-custom-intel-hinge: use common device for
devres
iio: temperature: hid-sensor-temperature: use common device for devres
iio: humidity: hid-sensor-humidity: use local struct device
iio: gyro: hid-sensor-gyro-3d: use local struct device
iio: accel: hid-sensor-accel-3d: use local struct device
iio: light: hid-sensor-als: use local struct device
iio: light: hid-sensor-prox: use local struct device
iio: magnetometer: hid-sensor-magn-3d: use local struct device
iio: orientation: hid-sensor-incl-3d: use local struct device
iio: orientation: hid-sensor-rotation: use local struct device
iio: position: hid-sensor-custom-intel-hinge: use local struct device
iio: pressure: hid-sensor-press: use local struct device
iio: hid-sensors: remove unused iio_dev argument
iio: hid-sensors: introduce device managed API
iio: gyro: hid-sensor-gyro-3d: drop hid_sensor_remove_trigger() using
devm API
iio: humidity: hid-sensor-humidity: drop hid_sensor_remove_trigger()
using devm API
iio: light: hid-sensor-prox: drop hid_sensor_remove_trigger() using
devm API
iio: light: hid-sensor-als: drop hid_sensor_remove_trigger() using
devm API
iio: magnetometer: hid-sensor-magn-3d: drop
hid_sensor_remove_trigger() using devm API
iio: orientation: hid-sensor-incl-3d: drop hid_sensor_remove_trigger()
using devm API
iio: orientation: hid-sensor-rotation: drop
hid_sensor_remove_trigger() using devm API
iio: position: hid-sensor-custom-intel-hinge: drop
hid_sensor_remove_trigger() using devm API
iio: pressure: hid-sensor-press: drop hid_sensor_remove_trigger()
using devm API
iio: temperature: hid-sensor-temperature: drop
hid_sensor_remove_trigger() using devm API

 drivers/iio/accel/hid-sensor-accel-3d.c       |  30 ++---
 .../common/hid-sensors/hid-sensor-trigger.c   |  24 +++-
 .../common/hid-sensors/hid-sensor-trigger.h   |   5 +-
 drivers/iio/gyro/hid-sensor-gyro-3d.c         |  96 ++++++++-------
 drivers/iio/humidity/hid-sensor-humidity.c    |  61 +++++-----
 drivers/iio/light/hid-sensor-als.c            |  31 +++--
 drivers/iio/light/hid-sensor-prox.c           |  30 ++---
 drivers/iio/magnetometer/hid-sensor-magn-3d.c | 112 +++++++++---------
 drivers/iio/orientation/hid-sensor-incl-3d.c  |  36 +++---
 drivers/iio/orientation/hid-sensor-rotation.c |  38 +++---
 .../position/hid-sensor-custom-intel-hinge.c  |  27 ++---
 drivers/iio/pressure/hid-sensor-press.c       |  36 +++---
 .../iio/temperature/hid-sensor-temperature.c  |  15 +--
 13 files changed, 264 insertions(+), 277 deletions(-)

base-commit: 08297ca8422541dde6c8b7e6b1d68bd4aa4568ef

Signature · 1 line
2.34.1