Skip to content

iio: light: opt4001: Fixes from code review

Nikhil Gautam linux-iio lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v24 patches 2 repliesSuperseded
  3. v14 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Patch 4: replaced tabs by spaces as suggested by Andy

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iio: light: opt4001: Fix power down clearing bits of the wrong registerdrivers/iio/light/opt4001.c+4 -230 replies
2/4iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem()drivers/iio/light/opt4001.c+3 -20 replies
3/4iio: light: opt4001: Reject integration times with a non-zero seconds partdrivers/iio/light/opt4001.c+3 -00 replies
4/4iio: light: opt4001: Fix reversed GENMASK() arguments in fault count maskdrivers/iio/light/opt4001.c+1 -10 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndy Shevchenko
SeriesR-b
1/4
2/4
3/4
4/4

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

Read the v3 thread

Cover letter [PATCH v3 0/4] iio: light: opt4001: Fixes from code review

Hi,

This series fixes a number of issues found while reviewing the opt4001 driver. All of them date back to the initial submission of the driver in commit 9a9608418292 ("iio: light: Add support for TI OPT4001 light sensor").

Patch 1 fixes the power down path, which read the device ID register instead of the control register in a read-modify-write, corrupting the CTRL configuration on the way to power down.

Patch 2 fixes an incompatible pointer type passed as the remainder argument to div_u64_rem(). No functional impact.

Patch 3 makes opt4001_write_raw() reject integration time writes with a non-zero integer (seconds) part, which were previously accepted silently based on the microseconds part alone.

Patch 4 fixes reversed GENMASK() arguments in the (currently unused) fault count mask definition and adds the _MASK suffix for consistency.

Changes in v3:
- Patch 4: replaced tabs by spaces as suggested by Andy

Changes in v2:
- Add Fixes: tags to all patches
- Patch 1: use regmap_clear_bits() directly in the opt4001_chip_off_action and drop opt4001_power_down() (Jonathan)
- Patch 2: document that there is no functional impact (Jonathan)
- Patch 3: add blank line after the early return (Jonathan)
- Patch 4: fix whitespace alignment of the new define

Regards,
Nikhil

Nikhil Gautam (4):
iio: light: opt4001: Fix power down clearing bits of the wrong
register
iio: light: opt4001: Fix incompatible pointer type passed to

    div_u64_rem()

iio: light: opt4001: Reject integration times with a non-zero seconds
part
iio: light: opt4001: Fix reversed GENMASK() arguments in fault count
mask

 drivers/iio/light/opt4001.c | 37 +++++++++++--------------------------
 1 file changed, 11 insertions(+), 26 deletions(-)
Signature · 1 line
2.39.5