Skip to content

Cleanup on I2C/SPI code

Rodrigo Siqueira linux-iio lkml 3 versions – Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 8 repliesApplied
  2. v28 patches 8 repliesSuperseded
  3. v17 patches 8 repliesSuperseded

Changes in v3 from the cover letter

- Adds clarifications related to authorship.
- Adds 'fixes' tag on the first two patches message.
- Removes unnecessary defines.
- Updates commit messages to better describe changes.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8staging:iio:ade7854: Fix error handling on read/writedrivers/staging/iio/meter/ade7854-i2c.c drivers/staging/iio/meter/ade7854.c+17 -171 reply
2/8staging:iio:ade7854: Fix the wrong number of bits to readdrivers/staging/iio/meter/ade7854-i2c.c+1 -11 reply
3/8staging:iio:ade7854: Rework I2C write functiondrivers/staging/iio/meter/ade7854-i2c.c+46 -501 reply
4/8staging:iio:ade7854: Rework SPI write functiondrivers/staging/iio/meter/ade7854-spi.c+41 -671 reply
5/8staging:iio:ade7854: Remove write_reg_* duplicationsdrivers/staging/iio/meter/ade7854-i2c.c drivers/staging/iio/meter/ade7854-spi.c drivers/staging/iio/meter/ade7854.c +1 more+12 -751 reply
6/8staging:iio:ade7854: Rework I2C read functiondrivers/staging/iio/meter/ade7854-i2c.c+37 -691 reply
7/8staging:iio:ade7854: Rework SPI read functiondrivers/staging/iio/meter/ade7854-spi.c+33 -1031 reply
8/8staging:iio:ade7854: Remove read_reg_* duplicationsdrivers/staging/iio/meter/ade7854-i2c.c drivers/staging/iio/meter/ade7854-spi.c drivers/staging/iio/meter/ade7854.c +1 more+15 -781 reply

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/8] Cleanup on I2C/SPI code

This patchset reworks the I2C/SPI code from meter module. The set of patches try to reduce the code duplication and make the communication reliable. The current version of the module had many code duplications, which make the code more error-prone and hard to read. Jonh Syne identified some wrong error handling and fixed it in his patches; in this series of patches I analyzed Jonh's fixes, and use it in the new code.

It is important to highlight that meter module is under observation, due to the lack of hardware and the old design of the chip. However, John has the hardware for testing and interest to help to update the code [1]. As a result, this patchset represents the first work effort to update the meter module in the staging.

1 - https://marc.info/?l=linux-iio&m=152046885922153&w=2

Changes in V2:
- Reorganize the patchset to make easier to backport fixes.
- Adds two commits at the beginning of the patchset. First, fixes bugs related to wrong verification in read/write I2C operations. Second, adjust the incorrect amount of data read.
- Removes unnecessary code in read/write functions for SPI and I2C during the rework.

Changes in V3:
- Adds clarifications related to authorship.
- Adds 'fixes' tag on the first two patches message.
- Removes unnecessary defines.
- Updates commit messages to better describe changes.

John Syne (2):
staging:iio:ade7854: Fix error handling on read/write staging:iio:ade7854: Fix the wrong number of bits to read

Rodrigo Siqueira (6):
staging:iio:ade7854: Rework I2C write function staging:iio:ade7854: Rework SPI write function staging:iio:ade7854: Remove write_reg_* duplications staging:iio:ade7854: Rework I2C read function staging:iio:ade7854: Rework SPI read function staging:iio:ade7854: Remove read_reg_* duplications

 drivers/staging/iio/meter/ade7854-i2c.c | 238 +++++++++-------------------
 drivers/staging/iio/meter/ade7854-spi.c | 268 +++++++-------------------------
 drivers/staging/iio/meter/ade7854.c     |  40 ++---
 drivers/staging/iio/meter/ade7854.h     |  16 +-
 4 files changed, 152 insertions(+), 410 deletions(-)
Signature · 6 lines
2.16.2

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel