Skip to content
Commit 638f958b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Chanwoo Choi
Browse files

extcon: Allow compile test of GPIO consumers if !GPIOLIB



The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

If GPIOLIB=n and asm-generic/gpio.h is not used:

    drivers/extcon/extcon-usb-gpio.c: In function ‘usb_extcon_detect_cable’:
    drivers/extcon/extcon-usb-gpio.c:63: error: implicit declaration of function ‘gpiod_get_value_cansleep’
    drivers/extcon/extcon-usb-gpio.c: In function ‘usb_extcon_probe’:
    drivers/extcon/extcon-usb-gpio.c:116: error: implicit declaration of function ‘devm_gpiod_get’
    drivers/extcon/extcon-usb-gpio.c:116: warning: assignment makes pointer from integer without a cast
    drivers/extcon/extcon-usb-gpio.c:122: error: implicit declaration of function ‘gpiod_set_debounce’
    drivers/extcon/extcon-usb-gpio.c:129: error: implicit declaration of function ‘gpiod_to_irq’

Add the missing #include <linux/gpio/consumer.h> to fix this.

Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent c571bbb4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment