]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: rohm-bd71828: Use regmap_reg_range()
authorMatti Vaittinen <mazziesaccount@gmail.com>
Mon, 15 Dec 2025 13:19:00 +0000 (15:19 +0200)
committerLee Jones <lee@kernel.org>
Tue, 13 Jan 2026 12:45:25 +0000 (12:45 +0000)
The regmap range tables tend to be somewhat verbose. Using the
regmap_reg_range() can make the definitions slightly mode compact.

Tidy the regmap range tables by using the regmap_reg_range().

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/49607e65ca117b096a50c5784b760bf62553e29a.1765804226.git.mazziesaccount@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/rohm-bd71828.c

index 84a64c3b9c9f52e663855c89ed78ede9a7c21f55..2a43005b67ee0d5faea830f0549872853efab9f8 100644 (file)
@@ -157,55 +157,27 @@ static struct mfd_cell bd71828_mfd_cells[] = {
 };
 
 static const struct regmap_range bd71815_volatile_ranges[] = {
-       {
-               .range_min = BD71815_REG_SEC,
-               .range_max = BD71815_REG_YEAR,
-       }, {
-               .range_min = BD71815_REG_CONF,
-               .range_max = BD71815_REG_BAT_TEMP,
-       }, {
-               .range_min = BD71815_REG_VM_IBAT_U,
-               .range_max = BD71815_REG_CC_CTRL,
-       }, {
-               .range_min = BD71815_REG_CC_STAT,
-               .range_max = BD71815_REG_CC_CURCD_L,
-       }, {
-               .range_min = BD71815_REG_VM_BTMP_MON,
-               .range_max = BD71815_REG_VM_BTMP_MON,
-       }, {
-               .range_min = BD71815_REG_INT_STAT,
-               .range_max = BD71815_REG_INT_UPDATE,
-       }, {
-               .range_min = BD71815_REG_VM_VSYS_U,
-               .range_max = BD71815_REG_REX_CTRL_1,
-       }, {
-               .range_min = BD71815_REG_FULL_CCNTD_3,
-               .range_max = BD71815_REG_CCNTD_CHG_2,
-       },
+       regmap_reg_range(BD71815_REG_SEC, BD71815_REG_YEAR),
+       regmap_reg_range(BD71815_REG_CONF, BD71815_REG_BAT_TEMP),
+       regmap_reg_range(BD71815_REG_VM_IBAT_U, BD71815_REG_CC_CTRL),
+       regmap_reg_range(BD71815_REG_CC_STAT, BD71815_REG_CC_CURCD_L),
+       regmap_reg_range(BD71815_REG_VM_BTMP_MON, BD71815_REG_VM_BTMP_MON),
+       regmap_reg_range(BD71815_REG_INT_STAT, BD71815_REG_INT_UPDATE),
+       regmap_reg_range(BD71815_REG_VM_VSYS_U, BD71815_REG_REX_CTRL_1),
+       regmap_reg_range(BD71815_REG_FULL_CCNTD_3, BD71815_REG_CCNTD_CHG_2),
 };
 
 static const struct regmap_range bd71828_volatile_ranges[] = {
-       {
-               .range_min = BD71828_REG_PS_CTRL_1,
-               .range_max = BD71828_REG_PS_CTRL_1,
-       }, {
-               .range_min = BD71828_REG_PS_CTRL_3,
-               .range_max = BD71828_REG_PS_CTRL_3,
-       }, {
-               .range_min = BD71828_REG_RTC_SEC,
-               .range_max = BD71828_REG_RTC_YEAR,
-       }, {
-               /*
-                * For now make all charger registers volatile because many
-                * needs to be and because the charger block is not that
-                * performance critical.
-                */
-               .range_min = BD71828_REG_CHG_STATE,
-               .range_max = BD71828_REG_CHG_FULL,
-       }, {
-               .range_min = BD71828_REG_INT_MAIN,
-               .range_max = BD71828_REG_IO_STAT,
-       },
+       regmap_reg_range(BD71828_REG_PS_CTRL_1, BD71828_REG_PS_CTRL_1),
+       regmap_reg_range(BD71828_REG_PS_CTRL_3, BD71828_REG_PS_CTRL_3),
+       regmap_reg_range(BD71828_REG_RTC_SEC, BD71828_REG_RTC_YEAR),
+       /*
+        * For now make all charger registers volatile because many
+        * needs to be and because the charger block is not that
+        * performance critical.
+        */
+       regmap_reg_range(BD71828_REG_CHG_STATE, BD71828_REG_CHG_FULL),
+       regmap_reg_range(BD71828_REG_INT_MAIN, BD71828_REG_IO_STAT),
 };
 
 static const struct regmap_access_table bd71815_volatile_regs = {