w1: w1-gpio: claim the gpio with correct initial flag

gpio_request_by_name should be called with proper flags.
The 0 value flag is invalid, and causes bad initialization of the gpio.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
This commit is contained in:
Eugen Hristev 2021-06-23 16:11:58 +03:00
parent 1311dd37ec
commit dffea443a3

View file

@ -156,7 +156,7 @@ static int w1_gpio_of_to_plat(struct udevice *dev)
struct w1_gpio_pdata *pdata = dev_get_plat(dev);
int ret;
ret = gpio_request_by_name(dev, "gpios", 0, &pdata->gpio, 0);
ret = gpio_request_by_name(dev, "gpios", 0, &pdata->gpio, GPIOD_IS_IN);
if (ret < 0)
printf("Error claiming GPIO %d\n", ret);