linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Simon Horman <horms+renesas@verge.net.au>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Ulrich Hecht <ulrich.hecht+renesas@gmail.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>,
	Takeshi Kihara <takeshi.kihara.df@renesas.com>,
	linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] pinctrl: ish-pfc: avoid unused variable warning
Date: Wed, 27 Apr 2016 11:56:49 +0200	[thread overview]
Message-ID: <1461751049-2751427-1-git-send-email-arnd@arndb.de> (raw)

After the conversion to devm_pinctrl_register, we get a warning in
sh_pfc_remove when CONFIG_PINCTRL_SH_PFC_GPIO is disabled:

drivers/pinctrl/sh-pfc/core.c: In function 'sh_pfc_remove':
drivers/pinctrl/sh-pfc/core.c:603:17: unused variable 'pfc' [-Werror=unused-variable]
  struct sh_pfc *pfc = platform_get_drvdata(pdev);

This moves the variable definition inside of the same ifdef
that has the only user, to get a clean build again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 67ec8d7b4846 ("pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration")
---
 drivers/pinctrl/sh-pfc/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 7ed9c80ba3ed..c9ee31c9952b 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -600,9 +600,9 @@ static int sh_pfc_probe(struct platform_device *pdev)
 
 static int sh_pfc_remove(struct platform_device *pdev)
 {
+#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
 	struct sh_pfc *pfc = platform_get_drvdata(pdev);
 
-#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
 	sh_pfc_unregister_gpiochip(pfc);
 #endif
 
-- 
2.7.0

             reply	other threads:[~2016-04-27  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27  9:56 Arnd Bergmann [this message]
2016-04-27  9:53 ` [PATCH] pinctrl: ish-pfc: avoid unused variable warning Laxman Dewangan
2016-04-27 14:13 ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461751049-2751427-1-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=geert+renesas@glider.be \
    --cc=hisashi.nakamura.ak@renesas.com \
    --cc=horms+renesas@verge.net.au \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=ldewangan@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=takeshi.kihara.df@renesas.com \
    --cc=ulrich.hecht+renesas@gmail.com \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).