All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove()
@ 2016-04-26 10:30 Geert Uytterhoeven
  2016-04-26 11:00   ` Laxman Dewangan
  2016-04-29  9:09 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-04-26 10:30 UTC (permalink / raw)
  To: Linus Walleij, Laxman Dewangan, Laurent Pinchart
  Cc: linux-gpio, linux-renesas-soc, Geert Uytterhoeven

If CONFIG_PINCTRL_SH_PFC_GPIO=n:

    drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
    drivers/pinctrl/sh-pfc/core.c:649:17: warning: unused variable 'pfc' [-Wunused-variable]

Fixes: 67ec8d7b48463904 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
I won't queue this up in sh-pfc-for-v4.7, as the offending commit is not in
that branch.

 drivers/pinctrl/sh-pfc/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index bde726977a3b4f02..fe931c2be38a2f3f 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -646,10 +646,8 @@ pr_info("%s:     PUD5 now is 0x%08x\n", __func__, data);
 
 static int sh_pfc_remove(struct platform_device *pdev)
 {
-	struct sh_pfc *pfc = platform_get_drvdata(pdev);
-
 #ifdef CONFIG_PINCTRL_SH_PFC_GPIO
-	sh_pfc_unregister_gpiochip(pfc);
+	sh_pfc_unregister_gpiochip(platform_get_drvdata(pdev));
 #endif
 
 	return 0;
-- 
1.9.1


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

* Re: [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove()
  2016-04-26 10:30 [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove() Geert Uytterhoeven
@ 2016-04-26 11:00   ` Laxman Dewangan
  2016-04-29  9:09 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Laxman Dewangan @ 2016-04-26 11:00 UTC (permalink / raw)
  To: Geert Uytterhoeven, Linus Walleij, Laurent Pinchart
  Cc: linux-gpio, linux-renesas-soc


On Tuesday 26 April 2016 04:00 PM, Geert Uytterhoeven wrote:
> If CONFIG_PINCTRL_SH_PFC_GPIO=n:
>
>      drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
>      drivers/pinctrl/sh-pfc/core.c:649:17: warning: unused variable 'pfc' [-Wunused-variable]
>
> Fixes: 67ec8d7b48463904 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> I won't queue this up in sh-pfc-for-v4.7, as the offending commit is not in
> that branch.
>

Ideally, you dont need the call of sh_pfc_unregister_gpiochip() if you 
use the devm_gpiochip_add_data() which is already available on all 
subsystem.

int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc)
{
         gpiochip_remove(&pfc->gpio->gpio_chip);
#ifdef CONFIG_SUPERH
         gpiochip_remove(&pfc->func->gpio_chip);
#endif
         return 0;
}

So you can get rid of this calls and lines.


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

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

* Re: [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove()
@ 2016-04-26 11:00   ` Laxman Dewangan
  0 siblings, 0 replies; 4+ messages in thread
From: Laxman Dewangan @ 2016-04-26 11:00 UTC (permalink / raw)
  To: Geert Uytterhoeven, Linus Walleij, Laurent Pinchart
  Cc: linux-gpio, linux-renesas-soc


On Tuesday 26 April 2016 04:00 PM, Geert Uytterhoeven wrote:
> If CONFIG_PINCTRL_SH_PFC_GPIO=n:
>
>      drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
>      drivers/pinctrl/sh-pfc/core.c:649:17: warning: unused variable 'pfc' [-Wunused-variable]
>
> Fixes: 67ec8d7b48463904 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> I won't queue this up in sh-pfc-for-v4.7, as the offending commit is not in
> that branch.
>

Ideally, you dont need the call of sh_pfc_unregister_gpiochip() if you 
use the devm_gpiochip_add_data() which is already available on all 
subsystem.

int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc)
{
         gpiochip_remove(&pfc->gpio->gpio_chip);
#ifdef CONFIG_SUPERH
         gpiochip_remove(&pfc->func->gpio_chip);
#endif
         return 0;
}

So you can get rid of this calls and lines.


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

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

* Re: [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove()
  2016-04-26 10:30 [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove() Geert Uytterhoeven
  2016-04-26 11:00   ` Laxman Dewangan
@ 2016-04-29  9:09 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2016-04-29  9:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Laxman Dewangan, Laurent Pinchart, linux-gpio, linux-renesas-soc

On Tue, Apr 26, 2016 at 12:30 PM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:

> If CONFIG_PINCTRL_SH_PFC_GPIO=n:
>
>     drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
>     drivers/pinctrl/sh-pfc/core.c:649:17: warning: unused variable 'pfc' [-Wunused-variable]
>
> Fixes: 67ec8d7b48463904 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> I won't queue this up in sh-pfc-for-v4.7, as the offending commit is not in
> that branch.

OK patch applied.

Yours,
Linus Walleij

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 10:30 [PATCH] pinctrl: sh-pfc: Kill unused variable in sh_pfc_remove() Geert Uytterhoeven
2016-04-26 11:00 ` Laxman Dewangan
2016-04-26 11:00   ` Laxman Dewangan
2016-04-29  9:09 ` 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.