net: ti: cpsw: include gpio/consumer.h
Subsystems (4)
PATCH 1/1 net: ti: cpsw: include gpio/consumer.h
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.
--- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/ti/cpsw.c +1 -1
@@ -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>
Signature · 1 line
2.9.0
From: Arnd Bergmann <[email protected]>
Date: Wed, 30 May 2018 23:51:54 +0200
Quoted 7 lines
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); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines
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 includegpio/consumer.hdirectly.Fixes 2652113ff043 ("net: ethernet: ti: Allow most drivers with COMPILE_TEST")Signed-off-by Arnd Bergmann <[email protected]>
Applied, thanks Arnd.