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

iio: adc: rohm-bd79112: Use regmap_reg_range()

Initializing the regmap_ranges using direct assignment to the range_min
and range_max members is slightly verbose. We can make it a tad cleaner
when using the regmap_reg_range() macro.

Clean up the code using regmap_reg_range() when initializing the
regmap_range structure.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Matti Vaittinen and committed by
Jonathan Cameron
d2e80531 1d165919

+4 -9
+4 -9
drivers/iio/adc/rohm-bd79112.c
··· 168 168 #define GET_GPI_VAL_REG(offset) _get_gpio_reg((offset), BD79112_REG_GPI_VALUE_A0_A7) 169 169 170 170 static const struct regmap_range bd71815_volatile_ro_ranges[] = { 171 - { 172 - /* Read ADC data */ 173 - .range_min = BD79112_REG_AGIO0A, 174 - .range_max = BD79112_REG_AGIO15B, 175 - }, { 176 - /* GPI state */ 177 - .range_min = BD79112_REG_GPI_VALUE_B8_15, 178 - .range_max = BD79112_REG_GPI_VALUE_A0_A7, 179 - }, 171 + /* Read ADC data */ 172 + regmap_reg_range(BD79112_REG_AGIO0A, BD79112_REG_AGIO15B), 173 + /* GPI state */ 174 + regmap_reg_range(BD79112_REG_GPI_VALUE_B8_15, BD79112_REG_GPI_VALUE_A0_A7), 180 175 }; 181 176 182 177 static const struct regmap_access_table bd79112_volatile_regs = {