linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ti: cpsw: include gpio/consumer.h
@ 2018-05-30 21:51 Arnd Bergmann
  2018-05-31 19:47 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-05-30 21:51 UTC (permalink / raw)
  To: David S. Miller, Grygorii Strashko
  Cc: linux-gpio, Florian Fainelli, Arnd Bergmann, Ivan Khoronzhuk,
	Keerthy, linux-omap, netdev, linux-kernel

On platforms that don't always enable CONFIG_GPIOLIB, we run into
a build failure:

drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_probe':
drivers/net/ethernet/ti/cpsw.c:3006:9: error: implicit declaration of function 'devm_gpiod_get_array_optional' [-Werror=implicit-function-declaration]
  mode = devm_gpiod_get_array_optional(&pdev->dev, "mode", GPIOD_OUT_LOW);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/cpsw.c:3006:59: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
  mode = devm_gpiod_get_array_optional(&pdev->dev, "mode", GPIOD_OUT_LOW);

Since we cannot rely on this to be visible from gpio.h, we have to include
gpio/consumer.h directly.

Fixes: 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/ti/cpsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 643cd2d9dfb6..534596ce00d3 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -29,7 +29,7 @@
 #include <linux/workqueue.h>
 #include <linux/delay.h>
 #include <linux/pm_runtime.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/of.h>
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
-- 
2.9.0

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

* Re: [PATCH] net: ti: cpsw: include gpio/consumer.h
  2018-05-30 21:51 [PATCH] net: ti: cpsw: include gpio/consumer.h Arnd Bergmann
@ 2018-05-31 19:47 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-05-31 19:47 UTC (permalink / raw)
  To: arnd
  Cc: grygorii.strashko, linux-gpio, f.fainelli, ivan.khoronzhuk,
	j-keerthy, linux-omap, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Wed, 30 May 2018 23:51:54 +0200

> On platforms that don't always enable CONFIG_GPIOLIB, we run into
> a build failure:
> 
> drivers/net/ethernet/ti/cpsw.c: In function 'cpsw_probe':
> drivers/net/ethernet/ti/cpsw.c:3006:9: error: implicit declaration of function 'devm_gpiod_get_array_optional' [-Werror=implicit-function-declaration]
>   mode = devm_gpiod_get_array_optional(&pdev->dev, "mode", GPIOD_OUT_LOW);
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/ethernet/ti/cpsw.c:3006:59: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'?
>   mode = devm_gpiod_get_array_optional(&pdev->dev, "mode", GPIOD_OUT_LOW);
> 
> Since we cannot rely on this to be visible from gpio.h, we have to include
> gpio/consumer.h directly.
> 
> Fixes: 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks Arnd.

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

end of thread, other threads:[~2018-05-31 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-30 21:51 [PATCH] net: ti: cpsw: include gpio/consumer.h Arnd Bergmann
2018-05-31 19:47 ` David Miller

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