]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: rohm-bd79124: Use regmap_reg_range()
authorMatti Vaittinen <mazziesaccount@gmail.com>
Mon, 27 Oct 2025 12:50:51 +0000 (14:50 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Nov 2025 12:57:05 +0000 (12:57 +0000)
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>
drivers/iio/adc/rohm-bd79124.c

index 06c55c8da93f329a8d90261d8969db18bc1b35af..fc0452749b7925a27b90fd2f98355ad8c250685e 100644 (file)
@@ -126,13 +126,8 @@ struct bd79124_data {
 };
 
 static const struct regmap_range bd79124_ro_ranges[] = {
-       {
-               .range_min = BD79124_REG_EVENT_FLAG,
-               .range_max = BD79124_REG_EVENT_FLAG,
-       }, {
-               .range_min = BD79124_REG_RECENT_CH0_LSB,
-               .range_max = BD79124_REG_RECENT_CH7_MSB,
-       },
+       regmap_reg_range(BD79124_REG_EVENT_FLAG, BD79124_REG_EVENT_FLAG),
+       regmap_reg_range(BD79124_REG_RECENT_CH0_LSB, BD79124_REG_RECENT_CH7_MSB),
 };
 
 static const struct regmap_access_table bd79124_ro_regs = {
@@ -141,22 +136,11 @@ static const struct regmap_access_table bd79124_ro_regs = {
 };
 
 static const struct regmap_range bd79124_volatile_ranges[] = {
-       {
-               .range_min = BD79124_REG_RECENT_CH0_LSB,
-               .range_max = BD79124_REG_RECENT_CH7_MSB,
-       }, {
-               .range_min = BD79124_REG_EVENT_FLAG,
-               .range_max = BD79124_REG_EVENT_FLAG,
-       }, {
-               .range_min = BD79124_REG_EVENT_FLAG_HI,
-               .range_max = BD79124_REG_EVENT_FLAG_HI,
-       }, {
-               .range_min = BD79124_REG_EVENT_FLAG_LO,
-               .range_max = BD79124_REG_EVENT_FLAG_LO,
-       }, {
-               .range_min = BD79124_REG_SYSTEM_STATUS,
-               .range_max = BD79124_REG_SYSTEM_STATUS,
-       },
+       regmap_reg_range(BD79124_REG_RECENT_CH0_LSB, BD79124_REG_RECENT_CH7_MSB),
+       regmap_reg_range(BD79124_REG_EVENT_FLAG, BD79124_REG_EVENT_FLAG),
+       regmap_reg_range(BD79124_REG_EVENT_FLAG_HI, BD79124_REG_EVENT_FLAG_HI),
+       regmap_reg_range(BD79124_REG_EVENT_FLAG_LO, BD79124_REG_EVENT_FLAG_LO),
+       regmap_reg_range(BD79124_REG_SYSTEM_STATUS, BD79124_REG_SYSTEM_STATUS),
 };
 
 static const struct regmap_access_table bd79124_volatile_regs = {
@@ -165,13 +149,8 @@ static const struct regmap_access_table bd79124_volatile_regs = {
 };
 
 static const struct regmap_range bd79124_precious_ranges[] = {
-       {
-               .range_min = BD79124_REG_EVENT_FLAG_HI,
-               .range_max = BD79124_REG_EVENT_FLAG_HI,
-       }, {
-               .range_min = BD79124_REG_EVENT_FLAG_LO,
-               .range_max = BD79124_REG_EVENT_FLAG_LO,
-       },
+       regmap_reg_range(BD79124_REG_EVENT_FLAG_HI, BD79124_REG_EVENT_FLAG_HI),
+       regmap_reg_range(BD79124_REG_EVENT_FLAG_LO, BD79124_REG_EVENT_FLAG_LO),
 };
 
 static const struct regmap_access_table bd79124_precious_regs = {