Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: Fix bad GENMASK use, typos, whitespace

Commit 7906dd52c5a0 ("iio: ina2xx: Fix whitespace and re-order code")
changed the register number of the MASK_ENABLE register from 0x06 to the
value equivalent GENMASK(2,1), although its no mask.
Also fix a typo (INA2_6_6 instead of INA2_2_6), and use the datasheet
name ("Mask/Enable") for the register number define.
Fix bad indentation for channel attributes.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Acked-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Stefan Brüns and committed by
Jonathan Cameron
ac23d64d de01d657

+6 -6
+6 -6
drivers/iio/adc/ina2xx-adc.c
··· 42 42 #define INA2XX_CURRENT 0x04 /* readonly */ 43 43 #define INA2XX_CALIBRATION 0x05 44 44 45 - #define INA226_ALERT_MASK GENMASK(2, 1) 46 - #define INA266_CVRF BIT(3) 45 + #define INA226_MASK_ENABLE 0x06 46 + #define INA226_CVRF BIT(3) 47 47 48 48 #define INA2XX_MAX_REGISTERS 8 49 49 ··· 417 417 .address = (_address), \ 418 418 .indexed = 1, \ 419 419 .channel = (_index), \ 420 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) \ 421 - | BIT(IIO_CHAN_INFO_SCALE), \ 420 + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 421 + BIT(IIO_CHAN_INFO_SCALE), \ 422 422 .info_mask_shared_by_dir = BIT(IIO_CHAN_INFO_SAMP_FREQ) | \ 423 423 BIT(IIO_CHAN_INFO_OVERSAMPLING_RATIO), \ 424 424 .scan_index = (_index), \ ··· 481 481 */ 482 482 if (!chip->allow_async_readout) 483 483 do { 484 - ret = regmap_read(chip->regmap, INA226_ALERT_MASK, 484 + ret = regmap_read(chip->regmap, INA226_MASK_ENABLE, 485 485 &alert); 486 486 if (ret < 0) 487 487 return ret; 488 488 489 - alert &= INA266_CVRF; 489 + alert &= INA226_CVRF; 490 490 } while (!alert); 491 491 492 492 /*