Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: mtx1-wdt: request gpio before using it

Otherwise, the gpiolib autorequest feature will produce a WARN_ON():

WARNING: at drivers/gpio/gpiolib.c:101 0x8020ec6c()
autorequest GPIO-215
[...]

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Cc: stable <stable@kernel.org>

authored by

Florian Fainelli and committed by
Wim Van Sebroeck
9b19d40a 076bad7c

+8
+8
drivers/watchdog/mtx-1_wdt.c
··· 214 214 int ret; 215 215 216 216 mtx1_wdt_device.gpio = pdev->resource[0].start; 217 + ret = gpio_request_one(mtx1_wdt_device.gpio, 218 + GPIOF_OUT_INIT_HIGH, "mtx1-wdt"); 219 + if (ret < 0) { 220 + dev_err(&pdev->dev, "failed to request gpio"); 221 + return ret; 222 + } 217 223 218 224 spin_lock_init(&mtx1_wdt_device.lock); 219 225 init_completion(&mtx1_wdt_device.stop); ··· 245 239 mtx1_wdt_device.queue = 0; 246 240 wait_for_completion(&mtx1_wdt_device.stop); 247 241 } 242 + 243 + gpio_free(mtx1_wdt_device.gpio); 248 244 misc_deregister(&mtx1_wdt_misc); 249 245 return 0; 250 246 }