linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mfd: rc5t583: set regmap config reg counts properly
@ 2016-01-31 21:58 Maciej S. Szmigiero
  2016-02-11 17:07 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Maciej S. Szmigiero @ 2016-01-31 21:58 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, ldewangan

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).

rc5t583 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/rc5t583.c       | 4 ++--
 include/linux/mfd/rc5t583.h | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index e10f02f5d551..fc2b2d93f354 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -241,8 +241,8 @@ static const struct regmap_config rc5t583_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 	.volatile_reg = volatile_reg,
-	.max_register = RC5T583_MAX_REGS,
-	.num_reg_defaults_raw = RC5T583_MAX_REGS,
+	.max_register = RC5T583_MAX_REG,
+	.num_reg_defaults_raw = RC5T583_NUM_REGS,
 	.cache_type = REGCACHE_RBTREE,
 };
 
diff --git a/include/linux/mfd/rc5t583.h b/include/linux/mfd/rc5t583.h
index fd413ccab915..8d0a392e0a7f 100644
--- a/include/linux/mfd/rc5t583.h
+++ b/include/linux/mfd/rc5t583.h
@@ -28,8 +28,6 @@
 #include <linux/types.h>
 #include <linux/regmap.h>
 
-#define RC5T583_MAX_REGS		0xF8
-
 /* Maximum number of main interrupts */
 #define MAX_MAIN_INTERRUPT		5
 #define RC5T583_MAX_GPEDGE_REG		2
@@ -169,6 +167,9 @@
 #define RC5T583_RTC_AY_MONTH 0xF3
 #define RC5T583_RTC_AY_YEAR	0xF4
 
+#define RC5T583_MAX_REG		0xF7
+#define RC5T583_NUM_REGS	(RC5T583_MAX_REG + 1)
+
 /* RICOH_RC5T583 IRQ definitions */
 enum {
 	RC5T583_IRQ_ONKEY,

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

* Re: mfd: rc5t583: set regmap config reg counts properly
  2016-01-31 21:58 mfd: rc5t583: set regmap config reg counts properly Maciej S. Szmigiero
@ 2016-02-11 17:07 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2016-02-11 17:07 UTC (permalink / raw)
  To: Maciej S. Szmigiero; +Cc: linux-kernel, ldewangan

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).
> 
> rc5t583 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/rc5t583.c       | 4 ++--
>  include/linux/mfd/rc5t583.h | 5 +++--
>  2 files changed, 5 insertions(+), 4 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/rc5t583.c b/drivers/mfd/rc5t583.c
> index e10f02f5d551..fc2b2d93f354 100644
> --- a/drivers/mfd/rc5t583.c
> +++ b/drivers/mfd/rc5t583.c
> @@ -241,8 +241,8 @@ static const struct regmap_config rc5t583_regmap_config = {
>  	.reg_bits = 8,
>  	.val_bits = 8,
>  	.volatile_reg = volatile_reg,
> -	.max_register = RC5T583_MAX_REGS,
> -	.num_reg_defaults_raw = RC5T583_MAX_REGS,
> +	.max_register = RC5T583_MAX_REG,
> +	.num_reg_defaults_raw = RC5T583_NUM_REGS,
>  	.cache_type = REGCACHE_RBTREE,
>  };
>  
> diff --git a/include/linux/mfd/rc5t583.h b/include/linux/mfd/rc5t583.h
> index fd413ccab915..8d0a392e0a7f 100644
> --- a/include/linux/mfd/rc5t583.h
> +++ b/include/linux/mfd/rc5t583.h
> @@ -28,8 +28,6 @@
>  #include <linux/types.h>
>  #include <linux/regmap.h>
>  
> -#define RC5T583_MAX_REGS		0xF8
> -
>  /* Maximum number of main interrupts */
>  #define MAX_MAIN_INTERRUPT		5
>  #define RC5T583_MAX_GPEDGE_REG		2
> @@ -169,6 +167,9 @@
>  #define RC5T583_RTC_AY_MONTH 0xF3
>  #define RC5T583_RTC_AY_YEAR	0xF4
>  
> +#define RC5T583_MAX_REG		0xF7
> +#define RC5T583_NUM_REGS	(RC5T583_MAX_REG + 1)
> +
>  /* RICOH_RC5T583 IRQ definitions */
>  enum {
>  	RC5T583_IRQ_ONKEY,

-- 
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] 2+ messages in thread

end of thread, other threads:[~2016-02-11 17:07 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).