linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: sun6i-prcm: fix build warning for non-OF configurations
@ 2019-04-16 12:24 Arnd Bergmann
  2019-04-16 12:41 ` Maxime Ripard
  2019-05-08  8:40 ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-04-16 12:24 UTC (permalink / raw)
  To: Lee Jones, Maxime Ripard, Chen-Yu Tsai
  Cc: Arnd Bergmann, linux-arm-kernel, linux-kernel

When CONFIG_OF is disabled, we get a harmless warning about an
unused variable:

drivers/mfd/sun6i-prcm.c: In function 'sun6i_prcm_probe':
drivers/mfd/sun6i-prcm.c:151:22: error: unused variable 'np' [-Werror=unused-variable]

Remove the variable and open-code the value in the only place
it is used, so it can get left out as well without CONFIG_OF.

Fixes: a05a2e7998ab ("mfd: sun6i-prcm: Allow to compile with COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mfd/sun6i-prcm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/sun6i-prcm.c b/drivers/mfd/sun6i-prcm.c
index 2b658bed47db..2f12a415b807 100644
--- a/drivers/mfd/sun6i-prcm.c
+++ b/drivers/mfd/sun6i-prcm.c
@@ -148,13 +148,12 @@ static const struct of_device_id sun6i_prcm_dt_ids[] = {
 
 static int sun6i_prcm_probe(struct platform_device *pdev)
 {
-	struct device_node *np = pdev->dev.of_node;
 	const struct of_device_id *match;
 	const struct prcm_data *data;
 	struct resource *res;
 	int ret;
 
-	match = of_match_node(sun6i_prcm_dt_ids, np);
+	match = of_match_node(sun6i_prcm_dt_ids, pdev->dev.of_node);
 	if (!match)
 		return -EINVAL;
 
-- 
2.20.0


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

* Re: [PATCH] mfd: sun6i-prcm: fix build warning for non-OF configurations
  2019-04-16 12:24 [PATCH] mfd: sun6i-prcm: fix build warning for non-OF configurations Arnd Bergmann
@ 2019-04-16 12:41 ` Maxime Ripard
  2019-05-08  8:40 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2019-04-16 12:41 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Lee Jones, Chen-Yu Tsai, linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On Tue, Apr 16, 2019 at 02:24:59PM +0200, Arnd Bergmann wrote:
> When CONFIG_OF is disabled, we get a harmless warning about an
> unused variable:
>
> drivers/mfd/sun6i-prcm.c: In function 'sun6i_prcm_probe':
> drivers/mfd/sun6i-prcm.c:151:22: error: unused variable 'np' [-Werror=unused-variable]
>
> Remove the variable and open-code the value in the only place
> it is used, so it can get left out as well without CONFIG_OF.
>
> Fixes: a05a2e7998ab ("mfd: sun6i-prcm: Allow to compile with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH] mfd: sun6i-prcm: fix build warning for non-OF configurations
  2019-04-16 12:24 [PATCH] mfd: sun6i-prcm: fix build warning for non-OF configurations Arnd Bergmann
  2019-04-16 12:41 ` Maxime Ripard
@ 2019-05-08  8:40 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2019-05-08  8:40 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel, linux-kernel

On Tue, 16 Apr 2019, Arnd Bergmann wrote:

> When CONFIG_OF is disabled, we get a harmless warning about an
> unused variable:
> 
> drivers/mfd/sun6i-prcm.c: In function 'sun6i_prcm_probe':
> drivers/mfd/sun6i-prcm.c:151:22: error: unused variable 'np' [-Werror=unused-variable]
> 
> Remove the variable and open-code the value in the only place
> it is used, so it can get left out as well without CONFIG_OF.
> 
> Fixes: a05a2e7998ab ("mfd: sun6i-prcm: Allow to compile with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/mfd/sun6i-prcm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2019-05-08  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 12:24 [PATCH] mfd: sun6i-prcm: fix build warning for non-OF configurations Arnd Bergmann
2019-04-16 12:41 ` Maxime Ripard
2019-05-08  8:40 ` 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).