diff --git a/recipes-kernel/touchdriver/kernel-module-touchgpio/src/touch_gpio.c b/recipes-kernel/touchdriver/kernel-module-touchgpio/src/touch_gpio.c index 35991ee2e9469e6768405b7bc7f53bd38ead45c9..ba61c6490799153456acb2ce9aa85dbce4b8816c 100644 --- a/recipes-kernel/touchdriver/kernel-module-touchgpio/src/touch_gpio.c +++ b/recipes-kernel/touchdriver/kernel-module-touchgpio/src/touch_gpio.c @@ -125,8 +125,12 @@ static struct touch_gpio * touch_gpio_allocate(struct device *dev) dev_err(dev, "Failed to allocate touch_gpio struct\n"); else gpios->dev = dev; - return gpios; + /* Initialize pins to -1, otherwise gpio_is_valid could evaluate them wrongly */ + gpios->reset_pin = -1; + gpios->wake_pin = -1; + gpios->irq_pin = -1; + return gpios; } void touch_gpio_free ( struct touch_gpio * gpios)