Skip to contentSkip to conversation

mfd: as3711: set regmap config reg counts properly

PATCH Applied Maciej S. Szmigiero 2 participants 3 messages Jan 31, 2016 – Feb 13, 2016 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

Regmap config max_register field should contain number of device last register, however num_reg_defaults_raw field should be set to register count instead
(usually one register more than max_register).

as3711 driver had both of these fields set to the same value, fix this by introducing separate defines for max register number and total count of registers.

---
 drivers/mfd/as3711.c       | 4 ++--
 include/linux/mfd/as3711.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/mfd/as3711.c +2 -2
index 94d67a6e1eb7..09e1483b99bc 100644
@@ -108,8 +108,8 @@ static const struct regmap_config as3711_regmap_config = {
 	.volatile_reg = as3711_volatile_reg,
 	.readable_reg = as3711_readable_reg,
 	.precious_reg = as3711_precious_reg,
-	.max_register = AS3711_MAX_REGS,
-	.num_reg_defaults_raw = AS3711_MAX_REGS,
+	.max_register = AS3711_MAX_REG,
+	.num_reg_defaults_raw = AS3711_NUM_REGS,
 	.cache_type = REGCACHE_RBTREE,
 };
 
include/linux/mfd/as3711.h +2 -1
index 38452ce1e892..34cc85864be5 100644
@@ -51,7 +51,8 @@
 #define AS3711_ASIC_ID_1		0x90
 #define AS3711_ASIC_ID_2		0x91
 
-#define AS3711_MAX_REGS			0x92
+#define AS3711_MAX_REG		AS3711_ASIC_ID_2
+#define AS3711_NUM_REGS		(AS3711_MAX_REG + 1)
 
 /* Regulators */
 enum {
Applied
#1 lore raw
Quoted 9 lines · Maciej S. Szmigiero

Regmap config max_register field should contain number of device last register, however num_reg_defaults_raw field should be set to register count instead
(usually one register more than max_register).

as3711 driver had both of these fields set to the same value, fix this by introducing separate defines for max register number and total count of registers.

Quoted 5 lines
---
 drivers/mfd/as3711.c       | 4 ++--
 include/linux/mfd/as3711.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

These 3 patches should really be submitted as a threaded set, so they stay together in one's inbox.

Also, please submit patches using the subject line format expected by the subsystem.

git log --oneline -- <subsystem> helps with this.

As you're a first time offender, I'll fix this for you this time.

Applied, thanks.

Quoted 29 lines
drivers/mfd/as3711.c +2 -2
index 94d67a6e1eb7..09e1483b99bc 100644
@@ -108,8 +108,8 @@ static const struct regmap_config as3711_regmap_config = {
 	.volatile_reg = as3711_volatile_reg,
 	.readable_reg = as3711_readable_reg,
 	.precious_reg = as3711_precious_reg,
-	.max_register = AS3711_MAX_REGS,
-	.num_reg_defaults_raw = AS3711_MAX_REGS,
+	.max_register = AS3711_MAX_REG,
+	.num_reg_defaults_raw = AS3711_NUM_REGS,
 	.cache_type = REGCACHE_RBTREE,
 };
 
include/linux/mfd/as3711.h +2 -1
index 38452ce1e892..34cc85864be5 100644
@@ -51,7 +51,8 @@
 #define AS3711_ASIC_ID_1		0x90
 #define AS3711_ASIC_ID_2		0x91
 
-#define AS3711_MAX_REGS			0x92
+#define AS3711_MAX_REG		AS3711_ASIC_ID_2
+#define AS3711_NUM_REGS		(AS3711_MAX_REG + 1)
 
 /* Regulators */
 enum {
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw
Quoted 20 lines · Lee Jones
Quoted 9 lines · Maciej S. Szmigiero

Regmap config max_register field should contain number of device last register, however num_reg_defaults_raw field should be set to register count instead
(usually one register more than max_register).

as3711 driver had both of these fields set to the same value, fix this by introducing separate defines for max register number and total count of registers.

Quoted 5 lines
---
 drivers/mfd/as3711.c       | 4 ++--
 include/linux/mfd/as3711.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

These 3 patches should really be submitted as a threaded set, so they stay together in one's inbox.

Quoted 8 lines

Also, please submit patches using the subject line format expected by the subsystem.

git log --oneline -- <subsystem> helps with this.

As you're a first time offender, I'll fix this for you this time.

Applied, thanks.

Thanks,
Maciej