All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-09-15 10:45 ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

It really is as simple as it sounds!

Lee Jones (7):
  mfd: max8997-irq: 'inline' should be at the beginning of the
    declaration
  mfd: ab8500-debugfs: Prevent initialised field from being over-written
  mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
  mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
  mfd: ab8500-debugfs: Remove 'weak' function
    suspend_test_wake_cause_interrupt_is_mine()
  mfd: omap-usb-host: Return value is not 'const int'
  mfd: cros_ec_spi: Remove unused variable 'request'

 drivers/mfd/ab8500-debugfs.c      | 114 ++++++++------------------------------
 drivers/mfd/cros_ec_spi.c         |   2 -
 drivers/mfd/db8500-prcmu.c        |  19 -------
 drivers/mfd/max8997-irq.c         |   2 +-
 drivers/mfd/omap-usb-host.c       |   2 +-
 include/linux/mfd/abx500/ab8500.h |   2 +
 include/linux/mfd/db8500-prcmu.h  |   6 --
 include/linux/mfd/dbx500-prcmu.h  |   9 ---
 8 files changed, 26 insertions(+), 130 deletions(-)

-- 
2.9.3

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

* [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-09-15 10:45 ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-kernel, linux-arm-kernel

It really is as simple as it sounds!

Lee Jones (7):
  mfd: max8997-irq: 'inline' should be at the beginning of the
    declaration
  mfd: ab8500-debugfs: Prevent initialised field from being over-written
  mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
  mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
  mfd: ab8500-debugfs: Remove 'weak' function
    suspend_test_wake_cause_interrupt_is_mine()
  mfd: omap-usb-host: Return value is not 'const int'
  mfd: cros_ec_spi: Remove unused variable 'request'

 drivers/mfd/ab8500-debugfs.c      | 114 ++++++++------------------------------
 drivers/mfd/cros_ec_spi.c         |   2 -
 drivers/mfd/db8500-prcmu.c        |  19 -------
 drivers/mfd/max8997-irq.c         |   2 +-
 drivers/mfd/omap-usb-host.c       |   2 +-
 include/linux/mfd/abx500/ab8500.h |   2 +
 include/linux/mfd/db8500-prcmu.h  |   6 --
 include/linux/mfd/dbx500-prcmu.h  |   9 ---
 8 files changed, 26 insertions(+), 130 deletions(-)

-- 
2.9.3

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

* [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-09-15 10:45 ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

It really is as simple as it sounds!

Lee Jones (7):
  mfd: max8997-irq: 'inline' should be at the beginning of the
    declaration
  mfd: ab8500-debugfs: Prevent initialised field from being over-written
  mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
  mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
  mfd: ab8500-debugfs: Remove 'weak' function
    suspend_test_wake_cause_interrupt_is_mine()
  mfd: omap-usb-host: Return value is not 'const int'
  mfd: cros_ec_spi: Remove unused variable 'request'

 drivers/mfd/ab8500-debugfs.c      | 114 ++++++++------------------------------
 drivers/mfd/cros_ec_spi.c         |   2 -
 drivers/mfd/db8500-prcmu.c        |  19 -------
 drivers/mfd/max8997-irq.c         |   2 +-
 drivers/mfd/omap-usb-host.c       |   2 +-
 include/linux/mfd/abx500/ab8500.h |   2 +
 include/linux/mfd/db8500-prcmu.h  |   6 --
 include/linux/mfd/dbx500-prcmu.h  |   9 ---
 8 files changed, 26 insertions(+), 130 deletions(-)

-- 
2.9.3

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

* [PATCH 1/7] mfd: max8997-irq: 'inline' should be at the beginning of the declaration
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

Reported by [-Wold-style-declaration].

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/max8997-irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
index b95a46d7..326f17b 100644
--- a/drivers/mfd/max8997-irq.c
+++ b/drivers/mfd/max8997-irq.c
@@ -139,7 +139,7 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
 	mutex_unlock(&max8997->irqlock);
 }
 
-static const inline struct max8997_irq_data *
+inline static const struct max8997_irq_data *
 irq_to_max8997_irq(struct max8997_dev *max8997, struct irq_data *data)
 {
 	return &max8997_irqs[data->hwirq];
-- 
2.9.3

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

* [PATCH 1/7] mfd: max8997-irq: 'inline' should be at the beginning of the declaration
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

Reported by [-Wold-style-declaration].

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/max8997-irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/max8997-irq.c b/drivers/mfd/max8997-irq.c
index b95a46d7..326f17b 100644
--- a/drivers/mfd/max8997-irq.c
+++ b/drivers/mfd/max8997-irq.c
@@ -139,7 +139,7 @@ static void max8997_irq_sync_unlock(struct irq_data *data)
 	mutex_unlock(&max8997->irqlock);
 }
 
-static const inline struct max8997_irq_data *
+inline static const struct max8997_irq_data *
 irq_to_max8997_irq(struct max8997_dev *max8997, struct irq_data *data)
 {
 	return &max8997_irqs[data->hwirq];
-- 
2.9.3

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

* [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

Due to the lack of parity in the way array fields have been named/
numbered, a mistake was made where more debug fields were declared
than actually existed.  In doing so, 2 fields were added, which
although unclear, were already declared in the array.  The result
was that the latter declarations trashed the former ones.

This patch places the array back in the correct order and removes
the offending NULL entries.

While we're at it, let's ensure this doesn't happen again by naming
each field properly and add a new *_LAST define to describe how
many fields there should be.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c      | 50 ++++++++++++++++-----------------------
 include/linux/mfd/abx500/ab8500.h |  2 ++
 2 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7b..6c913c4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -153,14 +153,14 @@ static struct hwreg_cfg hwreg_cfg = {
 
 #define AB8500_NAME_STRING "ab8500"
 #define AB8500_ADC_NAME_STRING "gpadc"
-#define AB8500_NUM_BANKS 24
+#define AB8500_NUM_BANKS AB8500_DEBUG_FIELD_LAST
 
 #define AB8500_REV_REG 0x80
 
 static struct ab8500_prcmu_ranges *debug_ranges;
 
 static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
-	[0x0] = {
+	[AB8500_M_FSM_RANK] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
@@ -315,7 +315,7 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x9] = {
+	[AB8500_RESERVED] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
@@ -386,24 +386,6 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[AB8500_DEVELOPMENT] = {
-		.num_ranges = 1,
-		.range = (struct ab8500_reg_range[]) {
-			{
-				.first = 0x00,
-				.last = 0x00,
-			},
-		},
-	},
-	[AB8500_DEBUG] = {
-		.num_ranges = 1,
-		.range = (struct ab8500_reg_range[]) {
-			{
-				.first = 0x05,
-				.last = 0x07,
-			},
-		},
-	},
 	[AB8500_AUDIO] = {
 		.num_ranges = 1,
 		.range = (struct ab8500_reg_range[]) {
@@ -463,19 +445,29 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x11] = {
-		.num_ranges = 0,
-		.range = NULL,
+	[AB8500_DEVELOPMENT] = {
+		.num_ranges = 1,
+		.range = (struct ab8500_reg_range[]) {
+			{
+				.first = 0x00,
+				.last = 0x00,
+			},
+		},
 	},
-	[0x12] = {
-		.num_ranges = 0,
-		.range = NULL,
+	[AB8500_DEBUG] = {
+		.num_ranges = 1,
+		.range = (struct ab8500_reg_range[]) {
+			{
+				.first = 0x05,
+				.last = 0x07,
+			},
+		},
 	},
-	[0x13] = {
+	[AB8500_PROD_TEST] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
-	[0x14] = {
+	[AB8500_STE_TEST] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 9475fee..d33c245 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -63,6 +63,8 @@ enum ab8500_version {
 #define AB8500_STE_TEST		0x14
 #define AB8500_OTP_EMUL		0x15
 
+#define AB8500_DEBUG_FIELD_LAST	0x16
+
 /*
  * Interrupts
  * Values used to index into array ab8500_irq_regoffset[] defined in
-- 
2.9.3

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

* [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

Due to the lack of parity in the way array fields have been named/
numbered, a mistake was made where more debug fields were declared
than actually existed.  In doing so, 2 fields were added, which
although unclear, were already declared in the array.  The result
was that the latter declarations trashed the former ones.

This patch places the array back in the correct order and removes
the offending NULL entries.

While we're at it, let's ensure this doesn't happen again by naming
each field properly and add a new *_LAST define to describe how
many fields there should be.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c      | 50 ++++++++++++++++-----------------------
 include/linux/mfd/abx500/ab8500.h |  2 ++
 2 files changed, 23 insertions(+), 29 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7b..6c913c4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -153,14 +153,14 @@ static struct hwreg_cfg hwreg_cfg = {
 
 #define AB8500_NAME_STRING "ab8500"
 #define AB8500_ADC_NAME_STRING "gpadc"
-#define AB8500_NUM_BANKS 24
+#define AB8500_NUM_BANKS AB8500_DEBUG_FIELD_LAST
 
 #define AB8500_REV_REG 0x80
 
 static struct ab8500_prcmu_ranges *debug_ranges;
 
 static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
-	[0x0] = {
+	[AB8500_M_FSM_RANK] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
@@ -315,7 +315,7 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x9] = {
+	[AB8500_RESERVED] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
@@ -386,24 +386,6 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[AB8500_DEVELOPMENT] = {
-		.num_ranges = 1,
-		.range = (struct ab8500_reg_range[]) {
-			{
-				.first = 0x00,
-				.last = 0x00,
-			},
-		},
-	},
-	[AB8500_DEBUG] = {
-		.num_ranges = 1,
-		.range = (struct ab8500_reg_range[]) {
-			{
-				.first = 0x05,
-				.last = 0x07,
-			},
-		},
-	},
 	[AB8500_AUDIO] = {
 		.num_ranges = 1,
 		.range = (struct ab8500_reg_range[]) {
@@ -463,19 +445,29 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x11] = {
-		.num_ranges = 0,
-		.range = NULL,
+	[AB8500_DEVELOPMENT] = {
+		.num_ranges = 1,
+		.range = (struct ab8500_reg_range[]) {
+			{
+				.first = 0x00,
+				.last = 0x00,
+			},
+		},
 	},
-	[0x12] = {
-		.num_ranges = 0,
-		.range = NULL,
+	[AB8500_DEBUG] = {
+		.num_ranges = 1,
+		.range = (struct ab8500_reg_range[]) {
+			{
+				.first = 0x05,
+				.last = 0x07,
+			},
+		},
 	},
-	[0x13] = {
+	[AB8500_PROD_TEST] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
-	[0x14] = {
+	[AB8500_STE_TEST] = {
 		.num_ranges = 0,
 		.range = NULL,
 	},
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 9475fee..d33c245 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -63,6 +63,8 @@ enum ab8500_version {
 #define AB8500_STE_TEST		0x14
 #define AB8500_OTP_EMUL		0x15
 
+#define AB8500_DEBUG_FIELD_LAST	0x16
+
 /*
  * Interrupts
  * Values used to index into array ab8500_irq_regoffset[] defined in
-- 
2.9.3

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

* [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

There are no call sites for these functions.  Strip them out.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/db8500-prcmu.c       | 19 -------------------
 include/linux/mfd/db8500-prcmu.h |  6 ------
 include/linux/mfd/dbx500-prcmu.h |  9 ---------
 3 files changed, 34 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 388e268..ca38a6a 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -938,25 +938,6 @@ int db8500_prcmu_get_ddr_opp(void)
 	return readb(PRCM_DDR_SUBSYS_APE_MINBW);
 }
 
-/**
- * db8500_set_ddr_opp - set the appropriate DDR OPP
- * @opp: The new DDR operating point to which transition is to be made
- * Returns: 0 on success, non-zero on failure
- *
- * This function sets the operating point of the DDR.
- */
-static bool enable_set_ddr_opp;
-int db8500_prcmu_set_ddr_opp(u8 opp)
-{
-	if (opp < DDR_100_OPP || opp > DDR_25_OPP)
-		return -EINVAL;
-	/* Changing the DDR OPP can hang the hardware pre-v21 */
-	if (enable_set_ddr_opp)
-		writeb(opp, PRCM_DDR_SUBSYS_APE_MINBW);
-
-	return 0;
-}
-
 /* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */
 static void request_even_slower_clocks(bool enable)
 {
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index 0bd6944..7ba67b5 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -538,7 +538,6 @@ int db8500_prcmu_get_arm_opp(void);
 int db8500_prcmu_set_ape_opp(u8 opp);
 int db8500_prcmu_get_ape_opp(void);
 int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
-int db8500_prcmu_set_ddr_opp(u8 opp);
 int db8500_prcmu_get_ddr_opp(void);
 
 u32 db8500_prcmu_read(unsigned int reg);
@@ -594,11 +593,6 @@ static inline int prcmu_release_usb_wakeup_state(void)
 	return 0;
 }
 
-static inline int db8500_prcmu_set_ddr_opp(u8 opp)
-{
-	return 0;
-}
-
 static inline int db8500_prcmu_get_ddr_opp(void)
 {
 	return DDR_100_OPP;
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5d37460..2e2c6a6 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -269,10 +269,6 @@ unsigned long prcmu_clock_rate(u8 clock);
 long prcmu_round_clock_rate(u8 clock, unsigned long rate);
 int prcmu_set_clock_rate(u8 clock, unsigned long rate);
 
-static inline int prcmu_set_ddr_opp(u8 opp)
-{
-	return db8500_prcmu_set_ddr_opp(opp);
-}
 static inline int prcmu_get_ddr_opp(void)
 {
 	return db8500_prcmu_get_ddr_opp();
@@ -489,11 +485,6 @@ static inline int prcmu_get_arm_opp(void)
 	return ARM_100_OPP;
 }
 
-static inline int prcmu_set_ddr_opp(u8 opp)
-{
-	return 0;
-}
-
 static inline int prcmu_get_ddr_opp(void)
 {
 	return DDR_100_OPP;
-- 
2.9.3

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

* [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

There are no call sites for these functions.  Strip them out.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/db8500-prcmu.c       | 19 -------------------
 include/linux/mfd/db8500-prcmu.h |  6 ------
 include/linux/mfd/dbx500-prcmu.h |  9 ---------
 3 files changed, 34 deletions(-)

diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 388e268..ca38a6a 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -938,25 +938,6 @@ int db8500_prcmu_get_ddr_opp(void)
 	return readb(PRCM_DDR_SUBSYS_APE_MINBW);
 }
 
-/**
- * db8500_set_ddr_opp - set the appropriate DDR OPP
- * @opp: The new DDR operating point to which transition is to be made
- * Returns: 0 on success, non-zero on failure
- *
- * This function sets the operating point of the DDR.
- */
-static bool enable_set_ddr_opp;
-int db8500_prcmu_set_ddr_opp(u8 opp)
-{
-	if (opp < DDR_100_OPP || opp > DDR_25_OPP)
-		return -EINVAL;
-	/* Changing the DDR OPP can hang the hardware pre-v21 */
-	if (enable_set_ddr_opp)
-		writeb(opp, PRCM_DDR_SUBSYS_APE_MINBW);
-
-	return 0;
-}
-
 /* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */
 static void request_even_slower_clocks(bool enable)
 {
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index 0bd6944..7ba67b5 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -538,7 +538,6 @@ int db8500_prcmu_get_arm_opp(void);
 int db8500_prcmu_set_ape_opp(u8 opp);
 int db8500_prcmu_get_ape_opp(void);
 int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
-int db8500_prcmu_set_ddr_opp(u8 opp);
 int db8500_prcmu_get_ddr_opp(void);
 
 u32 db8500_prcmu_read(unsigned int reg);
@@ -594,11 +593,6 @@ static inline int prcmu_release_usb_wakeup_state(void)
 	return 0;
 }
 
-static inline int db8500_prcmu_set_ddr_opp(u8 opp)
-{
-	return 0;
-}
-
 static inline int db8500_prcmu_get_ddr_opp(void)
 {
 	return DDR_100_OPP;
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5d37460..2e2c6a6 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -269,10 +269,6 @@ unsigned long prcmu_clock_rate(u8 clock);
 long prcmu_round_clock_rate(u8 clock, unsigned long rate);
 int prcmu_set_clock_rate(u8 clock, unsigned long rate);
 
-static inline int prcmu_set_ddr_opp(u8 opp)
-{
-	return db8500_prcmu_set_ddr_opp(opp);
-}
 static inline int prcmu_get_ddr_opp(void)
 {
 	return db8500_prcmu_get_ddr_opp();
@@ -489,11 +485,6 @@ static inline int prcmu_get_arm_opp(void)
 	return ARM_100_OPP;
 }
 
-static inline int prcmu_set_ddr_opp(u8 opp)
-{
-	return 0;
-}
-
 static inline int prcmu_get_ddr_opp(void)
 {
 	return DDR_100_OPP;
-- 
2.9.3

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

* [PATCH 4/7] mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
  2016-09-15 10:45 ` Lee Jones
  (?)
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

Doesn't appear to be used.  No call sites exist.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c | 54 --------------------------------------------
 1 file changed, 54 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 6c913c4..b948088 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1374,60 +1374,6 @@ void ab8500_dump_all_banks(struct device *dev)
 	}
 }
 
-/* Space for 500 registers. */
-#define DUMP_MAX_REGS 700
-static struct ab8500_register_dump
-{
-	u8 bank;
-	u8 reg;
-	u8 value;
-} ab8500_complete_register_dump[DUMP_MAX_REGS];
-
-/* This shall only be called upon kernel panic! */
-void ab8500_dump_all_banks_to_mem(void)
-{
-	int i, r = 0;
-	u8 bank;
-	int err = 0;
-
-	pr_info("Saving all ABB registers for crash analysis.\n");
-
-	for (bank = 0; bank < AB8500_NUM_BANKS; bank++) {
-		for (i = 0; i < debug_ranges[bank].num_ranges; i++) {
-			u8 reg;
-
-			for (reg = debug_ranges[bank].range[i].first;
-			     reg <= debug_ranges[bank].range[i].last;
-			     reg++) {
-				u8 value;
-
-				err = prcmu_abb_read(bank, reg, &value, 1);
-
-				if (err < 0)
-					goto out;
-
-				ab8500_complete_register_dump[r].bank = bank;
-				ab8500_complete_register_dump[r].reg = reg;
-				ab8500_complete_register_dump[r].value = value;
-
-				r++;
-
-				if (r >= DUMP_MAX_REGS) {
-					pr_err("%s: too many register to dump!\n",
-						__func__);
-					err = -EINVAL;
-					goto out;
-				}
-			}
-		}
-	}
-out:
-	if (err >= 0)
-		pr_info("Saved all ABB registers.\n");
-	else
-		pr_info("Failed to save all ABB registers.\n");
-}
-
 static int ab8500_all_banks_open(struct inode *inode, struct file *file)
 {
 	struct seq_file *s;
-- 
2.9.3

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

* [PATCH 4/7] mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-kernel, linux-arm-kernel

Doesn't appear to be used.  No call sites exist.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c | 54 --------------------------------------------
 1 file changed, 54 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 6c913c4..b948088 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1374,60 +1374,6 @@ void ab8500_dump_all_banks(struct device *dev)
 	}
 }
 
-/* Space for 500 registers. */
-#define DUMP_MAX_REGS 700
-static struct ab8500_register_dump
-{
-	u8 bank;
-	u8 reg;
-	u8 value;
-} ab8500_complete_register_dump[DUMP_MAX_REGS];
-
-/* This shall only be called upon kernel panic! */
-void ab8500_dump_all_banks_to_mem(void)
-{
-	int i, r = 0;
-	u8 bank;
-	int err = 0;
-
-	pr_info("Saving all ABB registers for crash analysis.\n");
-
-	for (bank = 0; bank < AB8500_NUM_BANKS; bank++) {
-		for (i = 0; i < debug_ranges[bank].num_ranges; i++) {
-			u8 reg;
-
-			for (reg = debug_ranges[bank].range[i].first;
-			     reg <= debug_ranges[bank].range[i].last;
-			     reg++) {
-				u8 value;
-
-				err = prcmu_abb_read(bank, reg, &value, 1);
-
-				if (err < 0)
-					goto out;
-
-				ab8500_complete_register_dump[r].bank = bank;
-				ab8500_complete_register_dump[r].reg = reg;
-				ab8500_complete_register_dump[r].value = value;
-
-				r++;
-
-				if (r >= DUMP_MAX_REGS) {
-					pr_err("%s: too many register to dump!\n",
-						__func__);
-					err = -EINVAL;
-					goto out;
-				}
-			}
-		}
-	}
-out:
-	if (err >= 0)
-		pr_info("Saved all ABB registers.\n");
-	else
-		pr_info("Failed to save all ABB registers.\n");
-}
-
 static int ab8500_all_banks_open(struct inode *inode, struct file *file)
 {
 	struct seq_file *s;
-- 
2.9.3

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

* [PATCH 4/7] mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

Doesn't appear to be used.  No call sites exist.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c | 54 --------------------------------------------
 1 file changed, 54 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 6c913c4..b948088 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1374,60 +1374,6 @@ void ab8500_dump_all_banks(struct device *dev)
 	}
 }
 
-/* Space for 500 registers. */
-#define DUMP_MAX_REGS 700
-static struct ab8500_register_dump
-{
-	u8 bank;
-	u8 reg;
-	u8 value;
-} ab8500_complete_register_dump[DUMP_MAX_REGS];
-
-/* This shall only be called upon kernel panic! */
-void ab8500_dump_all_banks_to_mem(void)
-{
-	int i, r = 0;
-	u8 bank;
-	int err = 0;
-
-	pr_info("Saving all ABB registers for crash analysis.\n");
-
-	for (bank = 0; bank < AB8500_NUM_BANKS; bank++) {
-		for (i = 0; i < debug_ranges[bank].num_ranges; i++) {
-			u8 reg;
-
-			for (reg = debug_ranges[bank].range[i].first;
-			     reg <= debug_ranges[bank].range[i].last;
-			     reg++) {
-				u8 value;
-
-				err = prcmu_abb_read(bank, reg, &value, 1);
-
-				if (err < 0)
-					goto out;
-
-				ab8500_complete_register_dump[r].bank = bank;
-				ab8500_complete_register_dump[r].reg = reg;
-				ab8500_complete_register_dump[r].value = value;
-
-				r++;
-
-				if (r >= DUMP_MAX_REGS) {
-					pr_err("%s: too many register to dump!\n",
-						__func__);
-					err = -EINVAL;
-					goto out;
-				}
-			}
-		}
-	}
-out:
-	if (err >= 0)
-		pr_info("Saved all ABB registers.\n");
-	else
-		pr_info("Failed to save all ABB registers.\n");
-}
-
 static int ab8500_all_banks_open(struct inode *inode, struct file *file)
 {
 	struct seq_file *s;
-- 
2.9.3

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

* [PATCH 5/7] mfd: ab8500-debugfs: Remove 'weak' function suspend_test_wake_cause_interrupt_is_mine()
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

There are no other functions which can over-ride it.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index b948088..acf6c00 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1522,18 +1522,10 @@ static u32 num_interrupts[AB8500_MAX_NR_IRQS];
 static u32 num_wake_interrupts[AB8500_MAX_NR_IRQS];
 static int num_interrupt_lines;
 
-bool __attribute__((weak)) suspend_test_wake_cause_interrupt_is_mine(u32 my_int)
-{
-	return false;
-}
-
 void ab8500_debug_register_interrupt(int line)
 {
-	if (line < num_interrupt_lines) {
+	if (line < num_interrupt_lines)
 		num_interrupts[line]++;
-		if (suspend_test_wake_cause_interrupt_is_mine(irq_ab8500))
-			num_wake_interrupts[line]++;
-	}
 }
 
 static int ab8500_interrupts_print(struct seq_file *s, void *p)
-- 
2.9.3

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

* [PATCH 5/7] mfd: ab8500-debugfs: Remove 'weak' function suspend_test_wake_cause_interrupt_is_mine()
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

There are no other functions which can over-ride it.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/ab8500-debugfs.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index b948088..acf6c00 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1522,18 +1522,10 @@ static u32 num_interrupts[AB8500_MAX_NR_IRQS];
 static u32 num_wake_interrupts[AB8500_MAX_NR_IRQS];
 static int num_interrupt_lines;
 
-bool __attribute__((weak)) suspend_test_wake_cause_interrupt_is_mine(u32 my_int)
-{
-	return false;
-}
-
 void ab8500_debug_register_interrupt(int line)
 {
-	if (line < num_interrupt_lines) {
+	if (line < num_interrupt_lines)
 		num_interrupts[line]++;
-		if (suspend_test_wake_cause_interrupt_is_mine(irq_ab8500))
-			num_wake_interrupts[line]++;
-	}
 }
 
 static int ab8500_interrupts_print(struct seq_file *s, void *p)
-- 
2.9.3

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

* [PATCH 6/7] mfd: omap-usb-host: Return value is not 'const int'
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

Change from 'const int' to just 'int'.

Cc: <robh+dt@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/omap-usb-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 1d924d1..7aab376 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -162,7 +162,7 @@ static const char * const port_modes[] = {
  * provided port mode string as per the port_modes table.
  * If no match is found it returns -ENODEV
  */
-static const int omap_usbhs_get_dt_port_mode(const char *mode)
+static int omap_usbhs_get_dt_port_mode(const char *mode)
 {
 	int i;
 
-- 
2.9.3

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

* [PATCH 6/7] mfd: omap-usb-host: Return value is not 'const int'
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

Change from 'const int' to just 'int'.

Cc: <robh+dt@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/omap-usb-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 1d924d1..7aab376 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -162,7 +162,7 @@ static const char * const port_modes[] = {
  * provided port mode string as per the port_modes table.
  * If no match is found it returns -ENODEV
  */
-static const int omap_usbhs_get_dt_port_mode(const char *mode)
+static int omap_usbhs_get_dt_port_mode(const char *mode)
 {
 	int i;
 
-- 
2.9.3

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

* [PATCH 7/7] mfd: cros_ec_spi: Remove unused variable 'request'
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 10:45   ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linus.walleij, tony, linux-omap; +Cc: linux-arm-kernel, linux-kernel

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/cros_ec_spi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index ebe9b94..a518832 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -366,7 +366,6 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
 static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
 				struct cros_ec_command *ec_msg)
 {
-	struct ec_host_request *request;
 	struct ec_host_response *response;
 	struct cros_ec_spi *ec_spi = ec_dev->priv;
 	struct spi_transfer trans, trans_delay;
@@ -378,7 +377,6 @@ static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
 	int ret = 0, final_ret;
 
 	len = cros_ec_prepare_tx(ec_dev, ec_msg);
-	request = (struct ec_host_request *)ec_dev->dout;
 	dev_dbg(ec_dev->dev, "prepared, len=%d\n", len);
 
 	/* If it's too soon to do another transaction, wait */
-- 
2.9.3

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

* [PATCH 7/7] mfd: cros_ec_spi: Remove unused variable 'request'
@ 2016-09-15 10:45   ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-09-15 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/cros_ec_spi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mfd/cros_ec_spi.c b/drivers/mfd/cros_ec_spi.c
index ebe9b94..a518832 100644
--- a/drivers/mfd/cros_ec_spi.c
+++ b/drivers/mfd/cros_ec_spi.c
@@ -366,7 +366,6 @@ static int cros_ec_spi_receive_response(struct cros_ec_device *ec_dev,
 static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
 				struct cros_ec_command *ec_msg)
 {
-	struct ec_host_request *request;
 	struct ec_host_response *response;
 	struct cros_ec_spi *ec_spi = ec_dev->priv;
 	struct spi_transfer trans, trans_delay;
@@ -378,7 +377,6 @@ static int cros_ec_pkt_xfer_spi(struct cros_ec_device *ec_dev,
 	int ret = 0, final_ret;
 
 	len = cros_ec_prepare_tx(ec_dev, ec_msg);
-	request = (struct ec_host_request *)ec_dev->dout;
 	dev_dbg(ec_dev->dev, "prepared, len=%d\n", len);
 
 	/* If it's too soon to do another transaction, wait */
-- 
2.9.3

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

* Re: [PATCH 1/7] mfd: max8997-irq: 'inline' should be at the beginning of the declaration
  2016-09-15 10:45   ` Lee Jones
@ 2016-09-15 11:28     ` Arnd Bergmann
  -1 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:28 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Lee Jones, linus.walleij, tony, linux-omap, linux-kernel

On Thursday, September 15, 2016 11:45:15 AM CEST Lee Jones wrote:
> -static const inline struct max8997_irq_data *
> +inline static const struct max8997_irq_data *

I think this causes another warning, the order should be
"stastic inline const struct max8997_irq_data".

	Arnd

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

* [PATCH 1/7] mfd: max8997-irq: 'inline' should be at the beginning of the declaration
@ 2016-09-15 11:28     ` Arnd Bergmann
  0 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, September 15, 2016 11:45:15 AM CEST Lee Jones wrote:
> -static const inline struct max8997_irq_data *
> +inline static const struct max8997_irq_data *

I think this causes another warning, the order should be
"stastic inline const struct max8997_irq_data".

	Arnd

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

* Re: [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written
  2016-09-15 10:45   ` Lee Jones
@ 2016-09-15 11:31     ` Arnd Bergmann
  -1 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Lee Jones, linus.walleij, tony, linux-omap, linux-kernel

On Thursday, September 15, 2016 11:45:16 AM CEST Lee Jones wrote:
> Due to the lack of parity in the way array fields have been named/
> numbered, a mistake was made where more debug fields were declared
> than actually existed.  In doing so, 2 fields were added, which
> although unclear, were already declared in the array.  The result
> was that the latter declarations trashed the former ones.
> 
> This patch places the array back in the correct order and removes
> the offending NULL entries.
> 
> While we're at it, let's ensure this doesn't happen again by naming
> each field properly and add a new *_LAST define to describe how
> many fields there should be.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/ab8500-debugfs.c      | 50 ++++++++++++++++-----------------------
>  include/linux/mfd/abx500/ab8500.h |  2 ++
>  2 files changed, 23 insertions(+), 29 deletions(-)

I tried doing the same thing at some point and never submitted.
For reference, here is my version. Yours looks better though,
so keep that.

	Arnd

commit daa445be130176d946af78e7a8460e44d3a792dd
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Wed Jun 8 10:29:18 2016 +0200

    mfd: ab8500: remove duplicate table entries
    
    gcc -Wextra finds two duplicate initializations for ab8500_debug_ranges:
    
    drivers/mfd/ab8500-debugfs.c:466:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:466:11: note: (near initialization for 'ab8500_debug_ranges[17]')
    drivers/mfd/ab8500-debugfs.c:470:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:470:11: note: (near initialization for 'ab8500_debug_ranges[18]')
    
    In both cases, one initialization looks valid, the other one overrides
    it with an empty one. I'm removing the empty overrides now, assuming
    they were not intentional.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7bd35f8..c23104b277c4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -463,14 +463,6 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x11] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
-	[0x12] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
 	[0x13] = {
 		.num_ranges = 0,
 		.range = NULL,

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

* [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written
@ 2016-09-15 11:31     ` Arnd Bergmann
  0 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, September 15, 2016 11:45:16 AM CEST Lee Jones wrote:
> Due to the lack of parity in the way array fields have been named/
> numbered, a mistake was made where more debug fields were declared
> than actually existed.  In doing so, 2 fields were added, which
> although unclear, were already declared in the array.  The result
> was that the latter declarations trashed the former ones.
> 
> This patch places the array back in the correct order and removes
> the offending NULL entries.
> 
> While we're at it, let's ensure this doesn't happen again by naming
> each field properly and add a new *_LAST define to describe how
> many fields there should be.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/ab8500-debugfs.c      | 50 ++++++++++++++++-----------------------
>  include/linux/mfd/abx500/ab8500.h |  2 ++
>  2 files changed, 23 insertions(+), 29 deletions(-)

I tried doing the same thing at some point and never submitted.
For reference, here is my version. Yours looks better though,
so keep that.

	Arnd

commit daa445be130176d946af78e7a8460e44d3a792dd
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Wed Jun 8 10:29:18 2016 +0200

    mfd: ab8500: remove duplicate table entries
    
    gcc -Wextra finds two duplicate initializations for ab8500_debug_ranges:
    
    drivers/mfd/ab8500-debugfs.c:466:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:466:11: note: (near initialization for 'ab8500_debug_ranges[17]')
    drivers/mfd/ab8500-debugfs.c:470:11: error: initialized field overwritten [-Werror=override-init]
    drivers/mfd/ab8500-debugfs.c:470:11: note: (near initialization for 'ab8500_debug_ranges[18]')
    
    In both cases, one initialization looks valid, the other one overrides
    it with an empty one. I'm removing the empty overrides now, assuming
    they were not intentional.
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index 0aecd7bd35f8..c23104b277c4 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -463,14 +463,6 @@ static struct ab8500_prcmu_ranges ab8500_debug_ranges[AB8500_NUM_BANKS] = {
 			},
 		},
 	},
-	[0x11] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
-	[0x12] = {
-		.num_ranges = 0,
-		.range = NULL,
-	},
 	[0x13] = {
 		.num_ranges = 0,
 		.range = NULL,

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

* Re: [PATCH 6/7] mfd: omap-usb-host: Return value is not 'const int'
  2016-09-15 10:45   ` Lee Jones
@ 2016-09-15 11:33     ` Arnd Bergmann
  -1 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:33 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Lee Jones, linus.walleij, tony, linux-omap, linux-kernel

On Thursday, September 15, 2016 11:45:20 AM CEST Lee Jones wrote:
> Change from 'const int' to just 'int'.
> 
> Cc: <robh+dt@kernel.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 

Looks good, I seem to have done the same thing. Also didn't submit,
so keep your version.

I tend to include the exact warning in the changelog, which here was

drivers/mfd/omap-usb-host.c:165:18: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

	Arnd

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

* [PATCH 6/7] mfd: omap-usb-host: Return value is not 'const int'
@ 2016-09-15 11:33     ` Arnd Bergmann
  0 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, September 15, 2016 11:45:20 AM CEST Lee Jones wrote:
> Change from 'const int' to just 'int'.
> 
> Cc: <robh+dt@kernel.org>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> 

Looks good, I seem to have done the same thing. Also didn't submit,
so keep your version.

I tend to include the exact warning in the changelog, which here was

drivers/mfd/omap-usb-host.c:165:18: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

	Arnd

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

* Re: [PATCH 0/7] mfd: Fix all W=1 warnings
  2016-09-15 10:45 ` Lee Jones
@ 2016-09-15 11:35   ` Arnd Bergmann
  -1 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:35 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Lee Jones, linus.walleij, tony, linux-omap, linux-kernel

On Thursday, September 15, 2016 11:45:14 AM CEST Lee Jones wrote:
> It really is as simple as it sounds!
> 

I seem to have one that you didn't find.

	Arnd

8<--------
>From 6c63171eba728fc6d8bc6358884deaccd4cee33d Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 4 Aug 2016 15:28:51 +0200
Subject: [PATCH] mfd: tps65912: move regmap config into core driver

When building with extra warnings enabled, most files including
linux/mfd/tps65912.h warn about a static variable defined in the
header:

include/linux/mfd/tps65912.h:331:35: warning: 'tps65912_regmap_config' defined but not used [-Wunused-const-variable=]

We also duplicate the data structure between the i2c and spi front-end
drivers. Moving it into the driver code avoids the warning and
the duplication.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c
index a88cfa80dbc4..f33567bc428d 100644
--- a/drivers/mfd/tps65912-core.c
+++ b/drivers/mfd/tps65912-core.c
@@ -77,6 +77,23 @@ static struct regmap_irq_chip tps65912_irq_chip = {
 	.init_ack_masked = true,
 };
 
+static const struct regmap_range tps65912_yes_ranges[] = {
+	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
+};
+
+static const struct regmap_access_table tps65912_volatile_table = {
+	.yes_ranges = tps65912_yes_ranges,
+	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
+};
+
+const struct regmap_config tps65912_regmap_config = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.cache_type = REGCACHE_RBTREE,
+	.volatile_table = &tps65912_volatile_table,
+};
+EXPORT_SYMBOL_GPL(tps65912_regmap_config);
+
 int tps65912_device_init(struct tps65912 *tps)
 {
 	int ret;
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
index 1a603701550e..b25d0297ba88 100644
--- a/include/linux/mfd/tps65912.h
+++ b/include/linux/mfd/tps65912.h
@@ -319,21 +319,7 @@ struct tps65912 {
 	struct regmap_irq_chip_data *irq_data;
 };
 
-static const struct regmap_range tps65912_yes_ranges[] = {
-	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
-};
-
-static const struct regmap_access_table tps65912_volatile_table = {
-	.yes_ranges = tps65912_yes_ranges,
-	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
-};
-
-static const struct regmap_config tps65912_regmap_config = {
-	.reg_bits = 8,
-	.val_bits = 8,
-	.cache_type = REGCACHE_RBTREE,
-	.volatile_table = &tps65912_volatile_table,
-};
+extern const struct regmap_config tps65912_regmap_config;
 
 int tps65912_device_init(struct tps65912 *tps);
 int tps65912_device_exit(struct tps65912 *tps);

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

* [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-09-15 11:35   ` Arnd Bergmann
  0 siblings, 0 replies; 34+ messages in thread
From: Arnd Bergmann @ 2016-09-15 11:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, September 15, 2016 11:45:14 AM CEST Lee Jones wrote:
> It really is as simple as it sounds!
> 

I seem to have one that you didn't find.

	Arnd

8<--------
>From 6c63171eba728fc6d8bc6358884deaccd4cee33d Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 4 Aug 2016 15:28:51 +0200
Subject: [PATCH] mfd: tps65912: move regmap config into core driver

When building with extra warnings enabled, most files including
linux/mfd/tps65912.h warn about a static variable defined in the
header:

include/linux/mfd/tps65912.h:331:35: warning: 'tps65912_regmap_config' defined but not used [-Wunused-const-variable=]

We also duplicate the data structure between the i2c and spi front-end
drivers. Moving it into the driver code avoids the warning and
the duplication.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c
index a88cfa80dbc4..f33567bc428d 100644
--- a/drivers/mfd/tps65912-core.c
+++ b/drivers/mfd/tps65912-core.c
@@ -77,6 +77,23 @@ static struct regmap_irq_chip tps65912_irq_chip = {
 	.init_ack_masked = true,
 };
 
+static const struct regmap_range tps65912_yes_ranges[] = {
+	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
+};
+
+static const struct regmap_access_table tps65912_volatile_table = {
+	.yes_ranges = tps65912_yes_ranges,
+	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
+};
+
+const struct regmap_config tps65912_regmap_config = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.cache_type = REGCACHE_RBTREE,
+	.volatile_table = &tps65912_volatile_table,
+};
+EXPORT_SYMBOL_GPL(tps65912_regmap_config);
+
 int tps65912_device_init(struct tps65912 *tps)
 {
 	int ret;
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
index 1a603701550e..b25d0297ba88 100644
--- a/include/linux/mfd/tps65912.h
+++ b/include/linux/mfd/tps65912.h
@@ -319,21 +319,7 @@ struct tps65912 {
 	struct regmap_irq_chip_data *irq_data;
 };
 
-static const struct regmap_range tps65912_yes_ranges[] = {
-	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
-};
-
-static const struct regmap_access_table tps65912_volatile_table = {
-	.yes_ranges = tps65912_yes_ranges,
-	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
-};
-
-static const struct regmap_config tps65912_regmap_config = {
-	.reg_bits = 8,
-	.val_bits = 8,
-	.cache_type = REGCACHE_RBTREE,
-	.volatile_table = &tps65912_volatile_table,
-};
+extern const struct regmap_config tps65912_regmap_config;
 
 int tps65912_device_init(struct tps65912 *tps);
 int tps65912_device_exit(struct tps65912 *tps);

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

* Re: [PATCH 0/7] mfd: Fix all W=1 warnings
  2016-09-15 10:45 ` Lee Jones
  (?)
@ 2016-09-15 12:44   ` Linus Walleij
  -1 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2016-09-15 12:44 UTC (permalink / raw)
  To: Lee Jones; +Cc: Tony Lindgren, Linux-OMAP, linux-arm-kernel, linux-kernel

On Thu, Sep 15, 2016 at 12:45 PM, Lee Jones <lee.jones@linaro.org> wrote:

> It really is as simple as it sounds!
>
> Lee Jones (7):
>   mfd: max8997-irq: 'inline' should be at the beginning of the
>     declaration
>   mfd: ab8500-debugfs: Prevent initialised field from being over-written
>   mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
>   mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
>   mfd: ab8500-debugfs: Remove 'weak' function
>     suspend_test_wake_cause_interrupt_is_mine()
>   mfd: omap-usb-host: Return value is not 'const int'
>   mfd: cros_ec_spi: Remove unused variable 'request'

Acked-by: Linus Walleij <linus.walleij@linaro.org>

For all the ab8500 and db8500 stuff.

Yours,
Linus Walleij

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

* Re: [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-09-15 12:44   ` Linus Walleij
  0 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2016-09-15 12:44 UTC (permalink / raw)
  To: Lee Jones; +Cc: Tony Lindgren, Linux-OMAP, linux-arm-kernel, linux-kernel

On Thu, Sep 15, 2016 at 12:45 PM, Lee Jones <lee.jones@linaro.org> wrote:

> It really is as simple as it sounds!
>
> Lee Jones (7):
>   mfd: max8997-irq: 'inline' should be at the beginning of the
>     declaration
>   mfd: ab8500-debugfs: Prevent initialised field from being over-written
>   mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
>   mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
>   mfd: ab8500-debugfs: Remove 'weak' function
>     suspend_test_wake_cause_interrupt_is_mine()
>   mfd: omap-usb-host: Return value is not 'const int'
>   mfd: cros_ec_spi: Remove unused variable 'request'

Acked-by: Linus Walleij <linus.walleij@linaro.org>

For all the ab8500 and db8500 stuff.

Yours,
Linus Walleij

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

* [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-09-15 12:44   ` Linus Walleij
  0 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2016-09-15 12:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 15, 2016 at 12:45 PM, Lee Jones <lee.jones@linaro.org> wrote:

> It really is as simple as it sounds!
>
> Lee Jones (7):
>   mfd: max8997-irq: 'inline' should be at the beginning of the
>     declaration
>   mfd: ab8500-debugfs: Prevent initialised field from being over-written
>   mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
>   mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem()
>   mfd: ab8500-debugfs: Remove 'weak' function
>     suspend_test_wake_cause_interrupt_is_mine()
>   mfd: omap-usb-host: Return value is not 'const int'
>   mfd: cros_ec_spi: Remove unused variable 'request'

Acked-by: Linus Walleij <linus.walleij@linaro.org>

For all the ab8500 and db8500 stuff.

Yours,
Linus Walleij

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

* Re: [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
  2016-09-15 10:45   ` Lee Jones
  (?)
@ 2016-10-06 20:35     ` Ulf Hansson
  -1 siblings, 0 replies; 34+ messages in thread
From: Ulf Hansson @ 2016-10-06 20:35 UTC (permalink / raw)
  To: Lee Jones
  Cc: Linus Walleij, Tony Lindgren, linux-omap, linux-arm-kernel, linux-kernel

On 15 September 2016 at 12:45, Lee Jones <lee.jones@linaro.org> wrote:
> There are no call sites for these functions.  Strip them out.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/db8500-prcmu.c       | 19 -------------------
>  include/linux/mfd/db8500-prcmu.h |  6 ------
>  include/linux/mfd/dbx500-prcmu.h |  9 ---------
>  3 files changed, 34 deletions(-)
>
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 388e268..ca38a6a 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -938,25 +938,6 @@ int db8500_prcmu_get_ddr_opp(void)
>         return readb(PRCM_DDR_SUBSYS_APE_MINBW);
>  }
>
> -/**
> - * db8500_set_ddr_opp - set the appropriate DDR OPP
> - * @opp: The new DDR operating point to which transition is to be made
> - * Returns: 0 on success, non-zero on failure
> - *
> - * This function sets the operating point of the DDR.
> - */
> -static bool enable_set_ddr_opp;
> -int db8500_prcmu_set_ddr_opp(u8 opp)
> -{
> -       if (opp < DDR_100_OPP || opp > DDR_25_OPP)
> -               return -EINVAL;
> -       /* Changing the DDR OPP can hang the hardware pre-v21 */
> -       if (enable_set_ddr_opp)
> -               writeb(opp, PRCM_DDR_SUBSYS_APE_MINBW);
> -
> -       return 0;
> -}
> -

This function was actually used in the vendor tree to deal with DVFS,
implemented a system wide PM QoS thing.
I guess those hacks never made it upstream. :-)

>  /* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */
>  static void request_even_slower_clocks(bool enable)
>  {
> diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
> index 0bd6944..7ba67b5 100644
> --- a/include/linux/mfd/db8500-prcmu.h
> +++ b/include/linux/mfd/db8500-prcmu.h
> @@ -538,7 +538,6 @@ int db8500_prcmu_get_arm_opp(void);
>  int db8500_prcmu_set_ape_opp(u8 opp);
>  int db8500_prcmu_get_ape_opp(void);
>  int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
> -int db8500_prcmu_set_ddr_opp(u8 opp);
>  int db8500_prcmu_get_ddr_opp(void);
>
>  u32 db8500_prcmu_read(unsigned int reg);
> @@ -594,11 +593,6 @@ static inline int prcmu_release_usb_wakeup_state(void)
>         return 0;
>  }
>
> -static inline int db8500_prcmu_set_ddr_opp(u8 opp)
> -{
> -       return 0;
> -}
> -
>  static inline int db8500_prcmu_get_ddr_opp(void)
>  {
>         return DDR_100_OPP;
> diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
> index 5d37460..2e2c6a6 100644
> --- a/include/linux/mfd/dbx500-prcmu.h
> +++ b/include/linux/mfd/dbx500-prcmu.h
> @@ -269,10 +269,6 @@ unsigned long prcmu_clock_rate(u8 clock);
>  long prcmu_round_clock_rate(u8 clock, unsigned long rate);
>  int prcmu_set_clock_rate(u8 clock, unsigned long rate);
>
> -static inline int prcmu_set_ddr_opp(u8 opp)
> -{
> -       return db8500_prcmu_set_ddr_opp(opp);
> -}
>  static inline int prcmu_get_ddr_opp(void)
>  {
>         return db8500_prcmu_get_ddr_opp();
> @@ -489,11 +485,6 @@ static inline int prcmu_get_arm_opp(void)
>         return ARM_100_OPP;
>  }
>
> -static inline int prcmu_set_ddr_opp(u8 opp)
> -{
> -       return 0;
> -}
> -
>  static inline int prcmu_get_ddr_opp(void)
>  {
>         return DDR_100_OPP;
> --
> 2.9.3
>

If not too late:

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* Re: [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
@ 2016-10-06 20:35     ` Ulf Hansson
  0 siblings, 0 replies; 34+ messages in thread
From: Ulf Hansson @ 2016-10-06 20:35 UTC (permalink / raw)
  To: Lee Jones
  Cc: Linus Walleij, Tony Lindgren, linux-omap, linux-arm-kernel, linux-kernel

On 15 September 2016 at 12:45, Lee Jones <lee.jones@linaro.org> wrote:
> There are no call sites for these functions.  Strip them out.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/db8500-prcmu.c       | 19 -------------------
>  include/linux/mfd/db8500-prcmu.h |  6 ------
>  include/linux/mfd/dbx500-prcmu.h |  9 ---------
>  3 files changed, 34 deletions(-)
>
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 388e268..ca38a6a 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -938,25 +938,6 @@ int db8500_prcmu_get_ddr_opp(void)
>         return readb(PRCM_DDR_SUBSYS_APE_MINBW);
>  }
>
> -/**
> - * db8500_set_ddr_opp - set the appropriate DDR OPP
> - * @opp: The new DDR operating point to which transition is to be made
> - * Returns: 0 on success, non-zero on failure
> - *
> - * This function sets the operating point of the DDR.
> - */
> -static bool enable_set_ddr_opp;
> -int db8500_prcmu_set_ddr_opp(u8 opp)
> -{
> -       if (opp < DDR_100_OPP || opp > DDR_25_OPP)
> -               return -EINVAL;
> -       /* Changing the DDR OPP can hang the hardware pre-v21 */
> -       if (enable_set_ddr_opp)
> -               writeb(opp, PRCM_DDR_SUBSYS_APE_MINBW);
> -
> -       return 0;
> -}
> -

This function was actually used in the vendor tree to deal with DVFS,
implemented a system wide PM QoS thing.
I guess those hacks never made it upstream. :-)

>  /* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */
>  static void request_even_slower_clocks(bool enable)
>  {
> diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
> index 0bd6944..7ba67b5 100644
> --- a/include/linux/mfd/db8500-prcmu.h
> +++ b/include/linux/mfd/db8500-prcmu.h
> @@ -538,7 +538,6 @@ int db8500_prcmu_get_arm_opp(void);
>  int db8500_prcmu_set_ape_opp(u8 opp);
>  int db8500_prcmu_get_ape_opp(void);
>  int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
> -int db8500_prcmu_set_ddr_opp(u8 opp);
>  int db8500_prcmu_get_ddr_opp(void);
>
>  u32 db8500_prcmu_read(unsigned int reg);
> @@ -594,11 +593,6 @@ static inline int prcmu_release_usb_wakeup_state(void)
>         return 0;
>  }
>
> -static inline int db8500_prcmu_set_ddr_opp(u8 opp)
> -{
> -       return 0;
> -}
> -
>  static inline int db8500_prcmu_get_ddr_opp(void)
>  {
>         return DDR_100_OPP;
> diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
> index 5d37460..2e2c6a6 100644
> --- a/include/linux/mfd/dbx500-prcmu.h
> +++ b/include/linux/mfd/dbx500-prcmu.h
> @@ -269,10 +269,6 @@ unsigned long prcmu_clock_rate(u8 clock);
>  long prcmu_round_clock_rate(u8 clock, unsigned long rate);
>  int prcmu_set_clock_rate(u8 clock, unsigned long rate);
>
> -static inline int prcmu_set_ddr_opp(u8 opp)
> -{
> -       return db8500_prcmu_set_ddr_opp(opp);
> -}
>  static inline int prcmu_get_ddr_opp(void)
>  {
>         return db8500_prcmu_get_ddr_opp();
> @@ -489,11 +485,6 @@ static inline int prcmu_get_arm_opp(void)
>         return ARM_100_OPP;
>  }
>
> -static inline int prcmu_set_ddr_opp(u8 opp)
> -{
> -       return 0;
> -}
> -
>  static inline int prcmu_get_ddr_opp(void)
>  {
>         return DDR_100_OPP;
> --
> 2.9.3
>

If not too late:

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls
@ 2016-10-06 20:35     ` Ulf Hansson
  0 siblings, 0 replies; 34+ messages in thread
From: Ulf Hansson @ 2016-10-06 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 15 September 2016 at 12:45, Lee Jones <lee.jones@linaro.org> wrote:
> There are no call sites for these functions.  Strip them out.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/db8500-prcmu.c       | 19 -------------------
>  include/linux/mfd/db8500-prcmu.h |  6 ------
>  include/linux/mfd/dbx500-prcmu.h |  9 ---------
>  3 files changed, 34 deletions(-)
>
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 388e268..ca38a6a 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -938,25 +938,6 @@ int db8500_prcmu_get_ddr_opp(void)
>         return readb(PRCM_DDR_SUBSYS_APE_MINBW);
>  }
>
> -/**
> - * db8500_set_ddr_opp - set the appropriate DDR OPP
> - * @opp: The new DDR operating point to which transition is to be made
> - * Returns: 0 on success, non-zero on failure
> - *
> - * This function sets the operating point of the DDR.
> - */
> -static bool enable_set_ddr_opp;
> -int db8500_prcmu_set_ddr_opp(u8 opp)
> -{
> -       if (opp < DDR_100_OPP || opp > DDR_25_OPP)
> -               return -EINVAL;
> -       /* Changing the DDR OPP can hang the hardware pre-v21 */
> -       if (enable_set_ddr_opp)
> -               writeb(opp, PRCM_DDR_SUBSYS_APE_MINBW);
> -
> -       return 0;
> -}
> -

This function was actually used in the vendor tree to deal with DVFS,
implemented a system wide PM QoS thing.
I guess those hacks never made it upstream. :-)

>  /* Divide the frequency of certain clocks by 2 for APE_50_PARTLY_25_OPP. */
>  static void request_even_slower_clocks(bool enable)
>  {
> diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
> index 0bd6944..7ba67b5 100644
> --- a/include/linux/mfd/db8500-prcmu.h
> +++ b/include/linux/mfd/db8500-prcmu.h
> @@ -538,7 +538,6 @@ int db8500_prcmu_get_arm_opp(void);
>  int db8500_prcmu_set_ape_opp(u8 opp);
>  int db8500_prcmu_get_ape_opp(void);
>  int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
> -int db8500_prcmu_set_ddr_opp(u8 opp);
>  int db8500_prcmu_get_ddr_opp(void);
>
>  u32 db8500_prcmu_read(unsigned int reg);
> @@ -594,11 +593,6 @@ static inline int prcmu_release_usb_wakeup_state(void)
>         return 0;
>  }
>
> -static inline int db8500_prcmu_set_ddr_opp(u8 opp)
> -{
> -       return 0;
> -}
> -
>  static inline int db8500_prcmu_get_ddr_opp(void)
>  {
>         return DDR_100_OPP;
> diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
> index 5d37460..2e2c6a6 100644
> --- a/include/linux/mfd/dbx500-prcmu.h
> +++ b/include/linux/mfd/dbx500-prcmu.h
> @@ -269,10 +269,6 @@ unsigned long prcmu_clock_rate(u8 clock);
>  long prcmu_round_clock_rate(u8 clock, unsigned long rate);
>  int prcmu_set_clock_rate(u8 clock, unsigned long rate);
>
> -static inline int prcmu_set_ddr_opp(u8 opp)
> -{
> -       return db8500_prcmu_set_ddr_opp(opp);
> -}
>  static inline int prcmu_get_ddr_opp(void)
>  {
>         return db8500_prcmu_get_ddr_opp();
> @@ -489,11 +485,6 @@ static inline int prcmu_get_arm_opp(void)
>         return ARM_100_OPP;
>  }
>
> -static inline int prcmu_set_ddr_opp(u8 opp)
> -{
> -       return 0;
> -}
> -
>  static inline int prcmu_get_ddr_opp(void)
>  {
>         return DDR_100_OPP;
> --
> 2.9.3
>

If not too late:

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

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

* Re: [PATCH 0/7] mfd: Fix all W=1 warnings
  2016-09-15 11:35   ` Arnd Bergmann
@ 2016-10-26 12:27     ` Lee Jones
  -1 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-10-26 12:27 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-kernel, linus.walleij, tony, linux-omap, linux-kernel

On Thu, 15 Sep 2016, Arnd Bergmann wrote:

> On Thursday, September 15, 2016 11:45:14 AM CEST Lee Jones wrote:
> > It really is as simple as it sounds!
> > 
> 
> I seem to have one that you didn't find.

Applied, thanks.

> 8<--------
> From 6c63171eba728fc6d8bc6358884deaccd4cee33d Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Thu, 4 Aug 2016 15:28:51 +0200
> Subject: [PATCH] mfd: tps65912: move regmap config into core driver
> 
> When building with extra warnings enabled, most files including
> linux/mfd/tps65912.h warn about a static variable defined in the
> header:
> 
> include/linux/mfd/tps65912.h:331:35: warning: 'tps65912_regmap_config' defined but not used [-Wunused-const-variable=]
> 
> We also duplicate the data structure between the i2c and spi front-end
> drivers. Moving it into the driver code avoids the warning and
> the duplication.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c
> index a88cfa80dbc4..f33567bc428d 100644
> --- a/drivers/mfd/tps65912-core.c
> +++ b/drivers/mfd/tps65912-core.c
> @@ -77,6 +77,23 @@ static struct regmap_irq_chip tps65912_irq_chip = {
>  	.init_ack_masked = true,
>  };
>  
> +static const struct regmap_range tps65912_yes_ranges[] = {
> +	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
> +};
> +
> +static const struct regmap_access_table tps65912_volatile_table = {
> +	.yes_ranges = tps65912_yes_ranges,
> +	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
> +};
> +
> +const struct regmap_config tps65912_regmap_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +	.cache_type = REGCACHE_RBTREE,
> +	.volatile_table = &tps65912_volatile_table,
> +};
> +EXPORT_SYMBOL_GPL(tps65912_regmap_config);
> +
>  int tps65912_device_init(struct tps65912 *tps)
>  {
>  	int ret;
> diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
> index 1a603701550e..b25d0297ba88 100644
> --- a/include/linux/mfd/tps65912.h
> +++ b/include/linux/mfd/tps65912.h
> @@ -319,21 +319,7 @@ struct tps65912 {
>  	struct regmap_irq_chip_data *irq_data;
>  };
>  
> -static const struct regmap_range tps65912_yes_ranges[] = {
> -	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
> -};
> -
> -static const struct regmap_access_table tps65912_volatile_table = {
> -	.yes_ranges = tps65912_yes_ranges,
> -	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
> -};
> -
> -static const struct regmap_config tps65912_regmap_config = {
> -	.reg_bits = 8,
> -	.val_bits = 8,
> -	.cache_type = REGCACHE_RBTREE,
> -	.volatile_table = &tps65912_volatile_table,
> -};
> +extern const struct regmap_config tps65912_regmap_config;
>  
>  int tps65912_device_init(struct tps65912 *tps);
>  int tps65912_device_exit(struct tps65912 *tps);
> 

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

* [PATCH 0/7] mfd: Fix all W=1 warnings
@ 2016-10-26 12:27     ` Lee Jones
  0 siblings, 0 replies; 34+ messages in thread
From: Lee Jones @ 2016-10-26 12:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 15 Sep 2016, Arnd Bergmann wrote:

> On Thursday, September 15, 2016 11:45:14 AM CEST Lee Jones wrote:
> > It really is as simple as it sounds!
> > 
> 
> I seem to have one that you didn't find.

Applied, thanks.

> 8<--------
> From 6c63171eba728fc6d8bc6358884deaccd4cee33d Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Thu, 4 Aug 2016 15:28:51 +0200
> Subject: [PATCH] mfd: tps65912: move regmap config into core driver
> 
> When building with extra warnings enabled, most files including
> linux/mfd/tps65912.h warn about a static variable defined in the
> header:
> 
> include/linux/mfd/tps65912.h:331:35: warning: 'tps65912_regmap_config' defined but not used [-Wunused-const-variable=]
> 
> We also duplicate the data structure between the i2c and spi front-end
> drivers. Moving it into the driver code avoids the warning and
> the duplication.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c
> index a88cfa80dbc4..f33567bc428d 100644
> --- a/drivers/mfd/tps65912-core.c
> +++ b/drivers/mfd/tps65912-core.c
> @@ -77,6 +77,23 @@ static struct regmap_irq_chip tps65912_irq_chip = {
>  	.init_ack_masked = true,
>  };
>  
> +static const struct regmap_range tps65912_yes_ranges[] = {
> +	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
> +};
> +
> +static const struct regmap_access_table tps65912_volatile_table = {
> +	.yes_ranges = tps65912_yes_ranges,
> +	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
> +};
> +
> +const struct regmap_config tps65912_regmap_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +	.cache_type = REGCACHE_RBTREE,
> +	.volatile_table = &tps65912_volatile_table,
> +};
> +EXPORT_SYMBOL_GPL(tps65912_regmap_config);
> +
>  int tps65912_device_init(struct tps65912 *tps)
>  {
>  	int ret;
> diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
> index 1a603701550e..b25d0297ba88 100644
> --- a/include/linux/mfd/tps65912.h
> +++ b/include/linux/mfd/tps65912.h
> @@ -319,21 +319,7 @@ struct tps65912 {
>  	struct regmap_irq_chip_data *irq_data;
>  };
>  
> -static const struct regmap_range tps65912_yes_ranges[] = {
> -	regmap_reg_range(TPS65912_INT_STS, TPS65912_GPIO5),
> -};
> -
> -static const struct regmap_access_table tps65912_volatile_table = {
> -	.yes_ranges = tps65912_yes_ranges,
> -	.n_yes_ranges = ARRAY_SIZE(tps65912_yes_ranges),
> -};
> -
> -static const struct regmap_config tps65912_regmap_config = {
> -	.reg_bits = 8,
> -	.val_bits = 8,
> -	.cache_type = REGCACHE_RBTREE,
> -	.volatile_table = &tps65912_volatile_table,
> -};
> +extern const struct regmap_config tps65912_regmap_config;
>  
>  int tps65912_device_init(struct tps65912 *tps);
>  int tps65912_device_exit(struct tps65912 *tps);
> 

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

end of thread, other threads:[~2016-10-26 12:27 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 10:45 [PATCH 0/7] mfd: Fix all W=1 warnings Lee Jones
2016-09-15 10:45 ` Lee Jones
2016-09-15 10:45 ` Lee Jones
2016-09-15 10:45 ` [PATCH 1/7] mfd: max8997-irq: 'inline' should be at the beginning of the declaration Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:28   ` Arnd Bergmann
2016-09-15 11:28     ` Arnd Bergmann
2016-09-15 10:45 ` [PATCH 2/7] mfd: ab8500-debugfs: Prevent initialised field from being over-written Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:31   ` Arnd Bergmann
2016-09-15 11:31     ` Arnd Bergmann
2016-09-15 10:45 ` [PATCH 3/7] mfd: db8500-prcmu: Remove unused *prcmu_set_ddr_opp() calls Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-10-06 20:35   ` Ulf Hansson
2016-10-06 20:35     ` Ulf Hansson
2016-10-06 20:35     ` Ulf Hansson
2016-09-15 10:45 ` [PATCH 4/7] mfd: ab8500-debugfs: Remove ab8500_dump_all_banks_to_mem() Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 10:45 ` [PATCH 5/7] mfd: ab8500-debugfs: Remove 'weak' function suspend_test_wake_cause_interrupt_is_mine() Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 10:45 ` [PATCH 6/7] mfd: omap-usb-host: Return value is not 'const int' Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:33   ` Arnd Bergmann
2016-09-15 11:33     ` Arnd Bergmann
2016-09-15 10:45 ` [PATCH 7/7] mfd: cros_ec_spi: Remove unused variable 'request' Lee Jones
2016-09-15 10:45   ` Lee Jones
2016-09-15 11:35 ` [PATCH 0/7] mfd: Fix all W=1 warnings Arnd Bergmann
2016-09-15 11:35   ` Arnd Bergmann
2016-10-26 12:27   ` Lee Jones
2016-10-26 12:27     ` Lee Jones
2016-09-15 12:44 ` Linus Walleij
2016-09-15 12:44   ` Linus Walleij
2016-09-15 12:44   ` Linus Walleij

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.