Skip to contentSkip to conversation

backlight: aw99706: Fix build errors caused by wrong gpio header

PATCH Applied Junjie Cao 3 participants 3 messages Jan 11 – Jan 20

Subsystems (3)
lore
Share & tools
lore

Junjie Cao

author
#0 lore raw

PATCH 1/1 backlight: aw99706: Fix build errors caused by wrong gpio header

The driver uses GPIO descriptor API (devm_gpiod_get, gpiod_set_value_cansleep, GPIOD_OUT_LOW) but includes the legacy <linux/gpio.h> header instead of <linux/gpio/consumer.h>.

When CONFIG_GPIOLIB is not set, <linux/gpio.h> does not include <linux/gpio/consumer.h>, causing build errors:

error: implicit declaration of function 'gpiod_set_value_cansleep'
error: implicit declaration of function 'devm_gpiod_get'
error: 'GPIOD_OUT_LOW' undeclared

Fix by including the correct header <linux/gpio/consumer.h>.

Fixes 147b38a5ad06 ("backlight: aw99706: Add support for Awinic AW99706 backlight")
---
 drivers/video/backlight/aw99706.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/aw99706.c +1 -1
index df5b23b2f753..938f352aaab7 100644
@@ -12,7 +12,7 @@
 #include <linux/backlight.h>
 #include <linux/bitfield.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/i2c.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Junjie Cao

The driver uses GPIO descriptor API (devm_gpiod_get, gpiod_set_value_cansleep, GPIOD_OUT_LOW) but includes the legacy <linux/gpio.h> header instead of <linux/gpio/consumer.h>.

When CONFIG_GPIOLIB is not set, <linux/gpio.h> does not include <linux/gpio/consumer.h>, causing build errors:

error: implicit declaration of function 'gpiod_set_value_cansleep'
error: implicit declaration of function 'devm_gpiod_get'
error: 'GPIOD_OUT_LOW' undeclared

Quoted 6 lines

Fix by including the correct header <linux/gpio/consumer.h>.

Fixes 147b38a5ad06 ("backlight: aw99706: Add support for Awinic AW99706 backlight")

Daniel.

maintainer Applied
#2 lore raw

Re: (subset) [PATCH] backlight: aw99706: Fix build errors caused by wrong gpio header

In reply to Junjie Cao
Quoted 8 lines · Junjie Cao

The driver uses GPIO descriptor API (devm_gpiod_get, gpiod_set_value_cansleep, GPIOD_OUT_LOW) but includes the legacy <linux/gpio.h> header instead of <linux/gpio/consumer.h>.

When CONFIG_GPIOLIB is not set, <linux/gpio.h> does not include <linux/gpio/consumer.h>, causing build errors:

[...]

Applied, thanks!

[1/1] backlight: aw99706: Fix build errors caused by wrong gpio header

      commit: b7db7d9c4ffc04210fe631f73a81746d6e2ef24b

--
Lee Jones [李琼斯]