[PATCH] ASoC: cs42xx8: Fix build error with CONFIG_GPIOLIB is not set
From: Shengjiu Wang
Date: Tue May 28 2019 - 23:30:02 EST
config: x86_64-randconfig-x000201921-201921
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
make ARCH=x86_64
sound/soc/codecs/cs42xx8.c: In function âcs42xx8_probeâ:
sound/soc/codecs/cs42xx8.c:472:25: error: implicit declaration of function âdevm_gpiod_get_optionalâ; did you mean âdevm_clk_get_optionalâ? [-Werror=implicit-function-declaration]
cs42xx8->gpiod_reset = devm_gpiod_get_optional(dev, "reset",
^~~~~~~~~~~~~~~~~~~~~~~
devm_clk_get_optional
sound/soc/codecs/cs42xx8.c:473:8: error: âGPIOD_OUT_HIGHâ undeclared (first use in this function); did you mean âGPIOF_INIT_HIGHâ?
GPIOD_OUT_HIGH);
^~~~~~~~~~~~~~
GPIOF_INIT_HIGH
sound/soc/codecs/cs42xx8.c:473:8: note: each undeclared identifier is reported only once for each function it appears in
sound/soc/codecs/cs42xx8.c:477:2: error: implicit declaration of function âgpiod_set_value_cansleepâ; did you mean âgpio_set_value_cansleepâ? [-Werror=implicit-function-declaration]
gpiod_set_value_cansleep(cs42xx8->gpiod_reset, 0);
^~~~~~~~~~~~~~~~~~~~~~~~
gpio_set_value_cansleep
Fixes: bfe95dfa4dac ("ASoC: cs42xx8: Add reset gpio handling")
Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Signed-off-by: Shengjiu Wang <shengjiu.wang@xxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
sound/soc/codecs/cs42xx8.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c
index b377cddaf2e6..6203f54d9f25 100644
--- a/sound/soc/codecs/cs42xx8.c
+++ b/sound/soc/codecs/cs42xx8.c
@@ -14,7 +14,7 @@
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/of_device.h>
-#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
#include <sound/pcm_params.h>
--
2.20.1