WATCHDOG: mtx1-wdt: request gpio before using it
Subsystems (2)
PATCH 2/3 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
[...]
---
drivers/watchdog/mtx-1_wdt.c +5 -0
@@ -214,6 +214,11 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev)int ret; mtx1_wdt_device.gpio = pdev->resource[0 ].start; + ret =gpio_request (mtx1_wdt_device.gpio,"mtx1-wdt" ); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to request gpio" ); +return ret; + }spin_lock_init (&mtx1_wdt_device.lock);init_completion (&mtx1_wdt_device.stop);
Signature · 1 line
1.7.4.1
Quoted 14 lines · Florian Fainelli
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 <[email protected]>---
drivers/watchdog/mtx-1_wdt.c +0
-0
drivers/watchdog/mtx-1_wdt.c static int __devinit mtx1_wdt_probe(struct platform_device *pdev) · line 221
Quoted 8 lines
drivers/watchdog/mtx-1_wdt.c +5
-0@@ -214,6 +214,11 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev)int ret; mtx1_wdt_device.gpio = pdev->resource[0 ].start; + ret =gpio_request (mtx1_wdt_device.gpio,"mtx1-wdt" ); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to request gpio" ); +return ret; + }
Could you use gpio_request_one() here to make sure the GPIO is in the correct direction first?
Jamie
Hello Jamie,
Quoted 21 lines · On Tuesday 07 June 2011 11:58:47 Jamie Iles wrote:
Quoted 20 lines · Florian Fainelli
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 <[email protected]>---
drivers/watchdog/mtx-1_wdt.c +0
-0@@ -214,6 +214,11 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev)int ret; mtx1_wdt_device.gpio = pdev->resource[0 ].start;
Quoted 8 lines
drivers/watchdog/mtx-1_wdt.c static int __devinit mtx1_wdt_probe(struct platform_device *pdev) · line 221
Quoted 5 lines
drivers/watchdog/mtx-1_wdt.c +5
-0+ ret =gpio_request (mtx1_wdt_device.gpio,"mtx1-wdt" ); +if (ret <0 ) { +dev_err (&pdev->dev,"failed to request gpio" ); +return ret; + }Could you use
gpio_request_one()here to make sure the GPIO is in the correct direction first?
Makes sense, I will respin a v2 of these.
--
Florian