Skip to contentSkip to conversation

phy: sun4i-usb: explicitly include gpio/consumer.h

PATCH In review Vinod Koul 3 participants 3 messages Jul 16, 2020

Subsystems (2)
lore
Share & tools
lore

Vinod Koul

author maintainer
#0 lore raw

PATCH 1/1 phy: sun4i-usb: explicitly include gpio/consumer.h

Driver uses GPIO functions but doesn't include the header explcitly. Add that to fix build errors when GPIOLIB is disabled.

drivers/phy/allwinner/phy-sun4i-usb.c:367:11: error: implicit declaration of function ‘gpiod_get_value_cansleep’; did you mean ‘gpio_get_value_cansleep’? [-Werror=implicit-function-declaration] drivers/phy/allwinner/phy-sun4i-usb.c:707:22: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_clk_get_optional’? [-Werror=implicit-function-declaration] drivers/phy/allwinner/phy-sun4i-usb.c:708:11: error: ‘GPIOD_IN’ undeclared (first use in this function); did you mean ‘GPIOF_IN’? drivers/phy/allwinner/phy-sun4i-usb.c:815:21: error: implicit declaration of function ‘gpiod_to_irq’; did you mean ‘gpio_to_irq’? [-Werror=implicit-function-declaration]

---
 drivers/phy/allwinner/phy-sun4i-usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/allwinner/phy-sun4i-usb.c +1 -0
index 7e09ad6a0b42..585d0a59e712 100644
@@ -16,6 +16,7 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/extcon-provider.h>
+#include <linux/gpio/consumer.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
Signature · 1 line
2.26.2
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Vinod Koul

Driver uses GPIO functions but doesn't include the header explcitly. Add that to fix build errors when GPIOLIB is disabled.

drivers/phy/allwinner/phy-sun4i-usb.c:367:11: error: implicit declaration of function ‘gpiod_get_value_cansleep’; did you mean ‘gpio_get_value_cansleep’? [-Werror=implicit-function-declaration] drivers/phy/allwinner/phy-sun4i-usb.c:707:22: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_clk_get_optional’? [-Werror=implicit-function-declaration] drivers/phy/allwinner/phy-sun4i-usb.c:708:11: error: ‘GPIOD_IN’ undeclared (first use in this function); did you mean ‘GPIOF_IN’? drivers/phy/allwinner/phy-sun4i-usb.c:815:21: error: implicit declaration of function ‘gpiod_to_irq’; did you mean ‘gpio_to_irq’? [-Werror=implicit-function-declaration]

Quoted 2 lines

Maybe add

Fixes ba4bdc9e1dc0 ("PHY: sunxi: Add driver for sunxi usb phy") ?

Though it probably doesn't apply cleanly on the oldest stable kernel due to the extcon-provider header.

Either way,

Acked-by on v1 1/1
#2 lore raw
In reply to Vinod Koul
Quoted 15 lines · Vinod Koul

Driver uses GPIO functions but doesn't include the header explcitly. Add that to fix build errors when GPIOLIB is disabled.

drivers/phy/allwinner/phy-sun4i-usb.c:367:11: error: implicit declaration of function ‘gpiod_get_value_cansleep’; did you mean ‘gpio_get_value_cansleep’? [-Werror=implicit-function-declaration] drivers/phy/allwinner/phy-sun4i-usb.c:707:22: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_clk_get_optional’? [-Werror=implicit-function-declaration] drivers/phy/allwinner/phy-sun4i-usb.c:708:11: error: ‘GPIOD_IN’ undeclared (first use in this function); did you mean ‘GPIOF_IN’? drivers/phy/allwinner/phy-sun4i-usb.c:815:21: error: implicit declaration of function ‘gpiod_to_irq’; did you mean ‘gpio_to_irq’? [-Werror=implicit-function-declaration]

Quoted 2 lines

Thanks.

Quoted 17 lines
---
 drivers/phy/allwinner/phy-sun4i-usb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/phy/allwinner/phy-sun4i-usb.c +1 -0
index 7e09ad6a0b42..585d0a59e712 100644
@@ -16,6 +16,7 @@
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/extcon-provider.h>
+#include <linux/gpio/consumer.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
Signature · 1 line
~Randy