[PATCH v2 0/5] iio: humidity: hts221: update probe and logging implementations

Adi Nata posted 5 patches 1 month, 2 weeks ago
drivers/iio/humidity/hts221_buffer.c |   1 +
drivers/iio/humidity/hts221_core.c   | 168 ++++++++++++---------------
drivers/iio/humidity/hts221_i2c.c    |  11 +-
drivers/iio/humidity/hts221_spi.c    |  11 +-
4 files changed, 84 insertions(+), 107 deletions(-)
[PATCH v2 0/5] iio: humidity: hts221: update probe and logging implementations
Posted by Adi Nata 1 month, 2 weeks ago
HTS221 is an older driver. This series groups a few small modernizations
based on current development practices.

- Report available values via read_avail()
- Add a blank line after variable declarations (style)
- Allow unknown whoami for DT fallback instead of erroring out
- Use dev_err_probe() in probe paths
- Reject calibration data that would cause division by zero

No HTS221 hardware was available. Verified with checkpatch --strict and
builds of hts221, hts221_i2c and hts221_spi. Probe and calibration
error paths were exercised against i2c-stub with register contents
pre-loaded via i2cset.

---
Changes in v2:
- Use a local 'dev' pointer instead of hw->dev in error logging helpers
- Fix punctuation in the commit message of patch 2/5
- Adjust commit message for patch 1/5 to include fixes due to ABI change 
of in_humidityrelative_oversampling_ratio_available

v1: https://lore.kernel.org/all/20260808090026.34187-1-adinata.softwareengineer@gmail.com/

Thanks to the reviewers for all the time you spent going through the
code and the comments.

Adi Nata (5):
  iio: humidity: hts221: report available values via read_avail()
  iio: humidity: hts221: Add a blank line after variable declarations
  iio: humidity: hts221: Allow unknown whoami for DT fallback
  iio: humidity: hts221: use dev_err_probe() in probe paths
  iio: humidity: hts221: fix division by zero in calibration parsing

 drivers/iio/humidity/hts221_buffer.c |   1 +
 drivers/iio/humidity/hts221_core.c   | 168 ++++++++++++---------------
 drivers/iio/humidity/hts221_i2c.c    |  11 +-
 drivers/iio/humidity/hts221_spi.c    |  11 +-
 4 files changed, 84 insertions(+), 107 deletions(-)

-- 
2.47.3
Re: [PATCH v2 0/5] iio: humidity: hts221: update probe and logging implementations
Posted by Andy Shevchenko 1 month, 1 week ago
On Thu, Aug 13, 2026 at 11:31:24PM +0800, Adi Nata wrote:
> HTS221 is an older driver. This series groups a few small modernizations
> based on current development practices.
> 
> - Report available values via read_avail()
> - Add a blank line after variable declarations (style)
> - Allow unknown whoami for DT fallback instead of erroring out
> - Use dev_err_probe() in probe paths
> - Reject calibration data that would cause division by zero
> 
> No HTS221 hardware was available. Verified with checkpatch --strict and
> builds of hts221, hts221_i2c and hts221_spi. Probe and calibration
> error paths were exercised against i2c-stub with register contents
> pre-loaded via i2cset.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v2 0/5] iio: humidity: hts221: update probe and logging implementations
Posted by Adi 1 month, 1 week ago
> Looks like you've fixed up the stuff Andy pointed out in v1 and all looked
> reasonable to me, so applied to the testing branch of iio.git.
>
> Note that branch will be rebased on 7.3-rc1 once available and only
> then pushed out for linux-next to pick up.
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

Thank you for the advice and help.

Regards,
Adi Nata
Re: [PATCH v2 0/5] iio: humidity: hts221: update probe and logging implementations
Posted by Jonathan Cameron 1 month, 1 week ago
On Mon, 17 Aug 2026 22:55:17 +0800
Adi <adinata.softwareengineer@gmail.com> wrote:

> > Looks like you've fixed up the stuff Andy pointed out in v1 and all looked
> > reasonable to me, so applied to the testing branch of iio.git.
> >
> > Note that branch will be rebased on 7.3-rc1 once available and only
> > then pushed out for linux-next to pick up.
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>  
> 
> Thank you for the advice and help.
> 
Added the tag.
Thanks

J
> Regards,
> Adi Nata
Re: [PATCH v2 0/5] iio: humidity: hts221: update probe and logging implementations
Posted by Jonathan Cameron 1 month, 1 week ago
On Thu, 13 Aug 2026 23:31:24 +0800
Adi Nata <adinata.softwareengineer@gmail.com> wrote:

> HTS221 is an older driver. This series groups a few small modernizations
> based on current development practices.
> 
> - Report available values via read_avail()
> - Add a blank line after variable declarations (style)
> - Allow unknown whoami for DT fallback instead of erroring out
> - Use dev_err_probe() in probe paths
> - Reject calibration data that would cause division by zero
> 
> No HTS221 hardware was available. Verified with checkpatch --strict and
> builds of hts221, hts221_i2c and hts221_spi. Probe and calibration
> error paths were exercised against i2c-stub with register contents
> pre-loaded via i2cset.
> 
> ---
> Changes in v2:
> - Use a local 'dev' pointer instead of hw->dev in error logging helpers
> - Fix punctuation in the commit message of patch 2/5
> - Adjust commit message for patch 1/5 to include fixes due to ABI change 
> of in_humidityrelative_oversampling_ratio_available
> 
Looks like you've fixed up the stuff Andy pointed out in v1 and all looked
reasonable to me, so applied to the testing branch of iio.git.

Note that branch will be rebased on 7.3-rc1 once available and only
then pushed out for linux-next to pick up.

Thanks,

Jonathan

> v1: https://lore.kernel.org/all/20260808090026.34187-1-adinata.softwareengineer@gmail.com/
> 
> Thanks to the reviewers for all the time you spent going through the
> code and the comments.
> 
> Adi Nata (5):
>   iio: humidity: hts221: report available values via read_avail()
>   iio: humidity: hts221: Add a blank line after variable declarations
>   iio: humidity: hts221: Allow unknown whoami for DT fallback
>   iio: humidity: hts221: use dev_err_probe() in probe paths
>   iio: humidity: hts221: fix division by zero in calibration parsing
> 
>  drivers/iio/humidity/hts221_buffer.c |   1 +
>  drivers/iio/humidity/hts221_core.c   | 168 ++++++++++++---------------
>  drivers/iio/humidity/hts221_i2c.c    |  11 +-
>  drivers/iio/humidity/hts221_spi.c    |  11 +-
>  4 files changed, 84 insertions(+), 107 deletions(-)
>