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

Sanjay Chitroda posted 36 patches 2 weeks, 1 day ago
Only 9 patches received!
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(-)
[PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors
Posted by Sanjay Chitroda 2 weeks, 1 day ago
From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

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/20260509101040.791404-1-sanjayembedded@gmail.com/
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/20260429175918.2541914-1-sanjayembedded@gmail.com/
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/20260428071613.1134053-1-sanjayembedded@gmail.com/

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
-- 
2.34.1
Re: [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors
Posted by Jonathan Cameron 1 week, 6 days ago
On Mon, 25 May 2026 00:50:23 +0530
Sanjay Chitroda <sanjayembeddedse@gmail.com> wrote:

> From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
> 
> 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/20260509101040.791404-1-sanjayembedded@gmail.com/
> 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/20260429175918.2541914-1-sanjayembedded@gmail.com/
> 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/20260428071613.1134053-1-sanjayembedded@gmail.com/
> 
> 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.
> 
The series is mostly fine, though not sure what happened with how you sent
it as I have it in seperate threads of 10 patches at a time. If you are having
email troubles with big series, use b4 to send them instead (instructions on kernel.org)

My main concern is this is a lot of churn on a critical driver. I'd like therefore
to be able to see the full benefit of those devm patches rather than get us
part way as this does.

Jonathan

> 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
Re: [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors
Posted by Andy Shevchenko 5 days, 23 hours ago
On Tue, May 26, 2026 at 04:56:51PM +0100, Jonathan Cameron wrote:
> On Mon, 25 May 2026 00:50:23 +0530
> Sanjay Chitroda <sanjayembeddedse@gmail.com> wrote:

> > 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/20260509101040.791404-1-sanjayembedded@gmail.com/
> > 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/20260429175918.2541914-1-sanjayembedded@gmail.com/
> > 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/20260428071613.1134053-1-sanjayembedded@gmail.com/
> > 
> > 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.
> > 
> The series is mostly fine, though not sure what happened with how you sent
> it as I have it in seperate threads of 10 patches at a time. If you are having
> email troubles with big series, use b4 to send them instead (instructions on kernel.org)

I'm also confused. Fix your email and then come with better series chaining.

> My main concern is this is a lot of churn on a critical driver. I'd like therefore
> to be able to see the full benefit of those devm patches rather than get us
> part way as this does.


-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors
Posted by srinivas pandruvada 1 week ago
On Tue, 2026-05-26 at 16:56 +0100, Jonathan Cameron wrote:
> On Mon, 25 May 2026 00:50:23 +0530
> Sanjay Chitroda <sanjayembeddedse@gmail.com> wrote:
> 
> > From: Sanjay Chitroda <sanjayembeddedse@gmail.com>
> > 
> > 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/20260509101040.791404-1-sanjayembedded@gmail.com/
> > 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/20260429175918.2541914-1-sanjayembedded@gmail.com/
> > 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/20260428071613.1134053-1-sanjayembedded@gmail.com/
> > 
> > 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.
> > 
> The series is mostly fine, though not sure what happened with how you
> sent
> it as I have it in seperate threads of 10 patches at a time. If you
> are having
> email troubles with big series, use b4 to send them instead
> (instructions on kernel.org)
> 
> My main concern is this is a lot of churn on a critical driver. I'd
> like therefore
> to be able to see the full benefit of those devm patches rather than
> get us
> part way as this does.
> 

I am not able to apply this patchset cleanly on 7.1-rc6. This series
does formatting changes, u32 changes and devm changes. Atleast three
different series will be better.

Thanks,
Srinivas


> Jonathan
> 
> > 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