All of lore.kernel.org
 help / color / mirror / Atom feed
* mfd: as3711: set regmap config reg counts properly
@ 2016-01-31 21:56 Maciej S. Szmigiero
  2016-02-11 17:07 ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej S. Szmigiero @ 2016-01-31 21:56 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Guennadi Liakhovetski

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.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
---
 drivers/mfd/as3711.c       | 4 ++--
 include/linux/mfd/as3711.h | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 94d67a6e1eb7..09e1483b99bc 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -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,
 };
 
diff --git a/include/linux/mfd/as3711.h b/include/linux/mfd/as3711.h
index 38452ce1e892..34cc85864be5 100644
--- a/include/linux/mfd/as3711.h
+++ b/include/linux/mfd/as3711.h
@@ -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 {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: mfd: as3711: set regmap config reg counts properly
  2016-01-31 21:56 mfd: as3711: set regmap config reg counts properly Maciej S. Szmigiero
@ 2016-02-11 17:07 ` Lee Jones
  2016-02-11 22:28   ` Maciej S. Szmigiero
  0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2016-02-11 17:07 UTC (permalink / raw)
  To: Maciej S. Szmigiero; +Cc: linux-kernel, Guennadi Liakhovetski

On Sun, 31 Jan 2016, Maciej S. Szmigiero wrote:

> 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.
> 
> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
> ---
>  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.

> diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
> index 94d67a6e1eb7..09e1483b99bc 100644
> --- a/drivers/mfd/as3711.c
> +++ b/drivers/mfd/as3711.c
> @@ -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,
>  };
>  
> diff --git a/include/linux/mfd/as3711.h b/include/linux/mfd/as3711.h
> index 38452ce1e892..34cc85864be5 100644
> --- a/include/linux/mfd/as3711.h
> +++ b/include/linux/mfd/as3711.h
> @@ -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 {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mfd: as3711: set regmap config reg counts properly
  2016-02-11 17:07 ` Lee Jones
@ 2016-02-11 22:28   ` Maciej S. Szmigiero
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej S. Szmigiero @ 2016-02-11 22:28 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Guennadi Liakhovetski

On 11.02.2016 18:07, Lee Jones wrote:
> On Sun, 31 Jan 2016, Maciej S. Szmigiero wrote:
> 
>> 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.
>>
>> Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
>> ---
>>  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.

Thanks,
Maciej

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-13 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-31 21:56 mfd: as3711: set regmap config reg counts properly Maciej S. Szmigiero
2016-02-11 17:07 ` Lee Jones
2016-02-11 22:28   ` Maciej S. Szmigiero

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.