summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/stmpe-gpio.c
diff options
context:
space:
mode:
authorVasiliy Kulikov <segooon@gmail.com>2010-09-12 20:57:19 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-10-29 00:29:32 +0200
commit02bf07492341d94e29890082201dd69dbf406570 (patch)
treef7430d2986cba406c62da5b009c03c99ca942d7f /drivers/gpio/stmpe-gpio.c
parentmfd: msp430 expects I2C to be built-in (diff)
downloadlinux-02bf07492341d94e29890082201dd69dbf406570.tar.xz
linux-02bf07492341d94e29890082201dd69dbf406570.zip
gpio: Fix stmpe error path
Free allocated memory. Call stmpe_disable() if it was enabled. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/gpio/stmpe-gpio.c')
-rw-r--r--drivers/gpio/stmpe-gpio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/stmpe-gpio.c b/drivers/gpio/stmpe-gpio.c
index 932759db1ac2..7c9e6a052c45 100644
--- a/drivers/gpio/stmpe-gpio.c
+++ b/drivers/gpio/stmpe-gpio.c
@@ -315,11 +315,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev)
ret = stmpe_enable(stmpe, STMPE_BLOCK_GPIO);
if (ret)
- return ret;
+ goto out_free;
ret = stmpe_gpio_irq_init(stmpe_gpio);
if (ret)
- goto out_free;
+ goto out_disable;
ret = request_threaded_irq(irq, NULL, stmpe_gpio_irq, IRQF_ONESHOT,
"stmpe-gpio", stmpe_gpio);
@@ -345,6 +345,8 @@ out_freeirq:
free_irq(irq, stmpe_gpio);
out_removeirq:
stmpe_gpio_irq_remove(stmpe_gpio);
+out_disable:
+ stmpe_disable(stmpe, STMPE_BLOCK_GPIO);
out_free:
kfree(stmpe_gpio);
return ret;