[PATCH 5.0 197/246] regulator: mcp16502: Include linux/gpio/consumer.h to fix build error

From: Greg Kroah-Hartman
Date: Thu Apr 04 2019 - 05:16:14 EST


5.0-stable review patch. If anyone has any objections, please let me know.

------------------

[ Upstream commit f3c6a1a194317f3a31ee2b2067bb0a41de64bc8b ]

Fix below build error:
drivers/regulator/mcp16502.c: In function âmcp16502_gpio_set_modeâ:
drivers/regulator/mcp16502.c:135:3: error: implicit declaration of function âgpiod_set_valueâ; did you mean âgpio_set_valueâ? [-Werror=implicit-function-declaration]
gpiod_set_value(mcp->lpm, 0);
^~~~~~~~~~~~~~~
gpio_set_value
drivers/regulator/mcp16502.c: In function âmcp16502_probeâ:
drivers/regulator/mcp16502.c:486:13: error: implicit declaration of function âdevm_gpiod_getâ; did you mean âdevm_gpio_freeâ? [-Werror=implicit-function-declaration]
mcp->lpm = devm_gpiod_get(dev, "lpm", GPIOD_OUT_LOW);
^~~~~~~~~~~~~~
devm_gpio_free
drivers/regulator/mcp16502.c:486:40: error: âGPIOD_OUT_LOWâ undeclared (first use in this function); did you mean âGPIOF_INIT_LOWâ?
mcp->lpm = devm_gpiod_get(dev, "lpm", GPIOD_OUT_LOW);
^~~~~~~~~~~~~
GPIOF_INIT_LOW

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
Acked-by: Nicolas Ferre <nicolas.ferre@xxxxxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/regulator/mcp16502.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c
index 3479ae009b0b..0fc4963bd5b0 100644
--- a/drivers/regulator/mcp16502.c
+++ b/drivers/regulator/mcp16502.c
@@ -17,6 +17,7 @@
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/suspend.h>
+#include <linux/gpio/consumer.h>

#define VDD_LOW_SEL 0x0D
#define VDD_HIGH_SEL 0x3F
--
2.19.1