linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused
@ 2016-05-03 15:26 Arnd Bergmann
  2016-05-03 15:26 ` [PATCH 2/2] pinctrl: ns2: rename pinctrl_utils_dt_free_map Arnd Bergmann
  2016-05-09  9:59 ` [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-05-03 15:26 UTC (permalink / raw)
  To: Linus Walleij, Alessandro Rubini
  Cc: Arnd Bergmann, Lee Jones, Laxman Dewangan, Heiko Stuebner,
	Thomas Gleixner, Jonas Gorski, Irina Tirdea, Masahiro Yamada,
	linux-arm-kernel, linux-gpio, linux-kernel

nmk_gpio_get_mode is only used in one place, and that is conditionally
compiled if DEBUG_FS is enabled. A recent cleanup has marked the
definition 'static', which now leads to a warning:

drivers/pinctrl/nomadik/pinctrl-nomadik.c:614:12: error: 'nmk_gpio_get_mode' defined but not used [-Werror=unused-function]
 static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
            ^~~~~~~~~~~~~~~~~

Moving the function itself inside the #ifdef shuts it up again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5e81e0a0913c ("pinctrl: nomadik: use BIT() with offsets consequently")
---
 drivers/pinctrl/nomadik/pinctrl-nomadik.c | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
index e5c71acd9506..ccbfc325c778 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -611,20 +611,6 @@ static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev,
 	return NMK_GPIO_ALT_C;
 }
 
-static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
-{
-	u32 afunc, bfunc;
-
-	clk_enable(nmk_chip->clk);
-
-	afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & BIT(offset);
-	bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & BIT(offset);
-
-	clk_disable(nmk_chip->clk);
-
-	return (afunc ? NMK_GPIO_ALT_A : 0) | (bfunc ? NMK_GPIO_ALT_B : 0);
-}
-
 /* IRQ functions */
 
 static void nmk_gpio_irq_ack(struct irq_data *d)
@@ -929,6 +915,19 @@ static int nmk_gpio_make_output(struct gpio_chip *chip, unsigned offset,
 }
 
 #ifdef CONFIG_DEBUG_FS
+static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
+{
+	u32 afunc, bfunc;
+
+	clk_enable(nmk_chip->clk);
+
+	afunc = readl(nmk_chip->addr + NMK_GPIO_AFSLA) & BIT(offset);
+	bfunc = readl(nmk_chip->addr + NMK_GPIO_AFSLB) & BIT(offset);
+
+	clk_disable(nmk_chip->clk);
+
+	return (afunc ? NMK_GPIO_ALT_A : 0) | (bfunc ? NMK_GPIO_ALT_B : 0);
+}
 
 #include <linux/seq_file.h>
 
-- 
2.7.0

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

* [PATCH 2/2] pinctrl: ns2: rename pinctrl_utils_dt_free_map
  2016-05-03 15:26 [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused Arnd Bergmann
@ 2016-05-03 15:26 ` Arnd Bergmann
  2016-05-09  9:57   ` Linus Walleij
  2016-05-09  9:59 ` [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2016-05-03 15:26 UTC (permalink / raw)
  To: Linus Walleij, Yendapally Reddy Dhananjaya Reddy, Ray Jui,
	Arnd Bergmann
  Cc: linux-gpio, linux-kernel

A conflict of two patches caused a build error when a function got renamed
but a new user appeared in the other patch:

drivers/pinctrl/bcm/pinctrl-ns2-mux.c:540:17: error: 'pinctrl_utils_dt_free_map' undeclared here (not in a function)
  .dt_free_map = pinctrl_utils_dt_free_map,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~

This renames the new user of pinctrl_utils_dt_free_map accordingly.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: d32f7fd3bbc3 ("pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map")
Fixes: b5aa1006e4a9 ("pinctrl: ns2: add pinmux driver support for Broadcom NS2 SoC")
---
 drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
index 1fd57db52d7b..3fefd14acc3e 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
@@ -537,7 +537,7 @@ static struct pinctrl_ops ns2_pinctrl_ops = {
 	.get_group_pins = ns2_get_group_pins,
 	.pin_dbg_show = ns2_pin_dbg_show,
 	.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
-	.dt_free_map = pinctrl_utils_dt_free_map,
+	.dt_free_map = pinctrl_utils_free_map,
 };
 
 static int ns2_get_functions_count(struct pinctrl_dev *pctrl_dev)
-- 
2.7.0

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

* Re: [PATCH 2/2] pinctrl: ns2: rename pinctrl_utils_dt_free_map
  2016-05-03 15:26 ` [PATCH 2/2] pinctrl: ns2: rename pinctrl_utils_dt_free_map Arnd Bergmann
@ 2016-05-09  9:57   ` Linus Walleij
  0 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-05-09  9:57 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Yendapally Reddy Dhananjaya Reddy, Ray Jui,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org

On Tue, May 3, 2016 at 5:26 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> A conflict of two patches caused a build error when a function got renamed
> but a new user appeared in the other patch:
>
> drivers/pinctrl/bcm/pinctrl-ns2-mux.c:540:17: error: 'pinctrl_utils_dt_free_map' undeclared here (not in a function)
>   .dt_free_map = pinctrl_utils_dt_free_map,
>                  ^~~~~~~~~~~~~~~~~~~~~~~~~
>
> This renames the new user of pinctrl_utils_dt_free_map accordingly.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: d32f7fd3bbc3 ("pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map")
> Fixes: b5aa1006e4a9 ("pinctrl: ns2: add pinmux driver support for Broadcom NS2 SoC")

Patch applied.

Sorry for taking so long. Mail Swamp.

Yours,
Linus Walleij

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

* Re: [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused
  2016-05-03 15:26 [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused Arnd Bergmann
  2016-05-03 15:26 ` [PATCH 2/2] pinctrl: ns2: rename pinctrl_utils_dt_free_map Arnd Bergmann
@ 2016-05-09  9:59 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-05-09  9:59 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alessandro Rubini, Lee Jones, Laxman Dewangan, Heiko Stuebner,
	Thomas Gleixner, Jonas Gorski, Irina Tirdea, Masahiro Yamada,
	linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org

On Tue, May 3, 2016 at 5:26 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> nmk_gpio_get_mode is only used in one place, and that is conditionally
> compiled if DEBUG_FS is enabled. A recent cleanup has marked the
> definition 'static', which now leads to a warning:
>
> drivers/pinctrl/nomadik/pinctrl-nomadik.c:614:12: error: 'nmk_gpio_get_mode' defined but not used [-Werror=unused-function]
>  static int nmk_gpio_get_mode(struct nmk_gpio_chip *nmk_chip, int offset)
>             ^~~~~~~~~~~~~~~~~
>
> Moving the function itself inside the #ifdef shuts it up again.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 5e81e0a0913c ("pinctrl: nomadik: use BIT() with offsets consequently")

Patch applied!

Yours,
Linus Walleij

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

end of thread, other threads:[~2016-05-09  9:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 15:26 [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused Arnd Bergmann
2016-05-03 15:26 ` [PATCH 2/2] pinctrl: ns2: rename pinctrl_utils_dt_free_map Arnd Bergmann
2016-05-09  9:57   ` Linus Walleij
2016-05-09  9:59 ` [PATCH 1/2] pinctrl: nomadik: hide nmk_gpio_get_mode when unused Linus Walleij

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