summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-generic.c
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-04-11 21:23:22 +0400
committerLinus Walleij <linus.walleij@linaro.org>2013-04-11 19:33:54 +0200
commit2ce7c62d1b18dca13c715c6bc2eea17f723576ff (patch)
treedc2abc55393213a296e1ad6418922003677c4077 /drivers/gpio/gpio-generic.c
parent7fc7acb9a0b0ff3ffdf21818fe0735ebaf4fecb8 (diff)
downloadop-kernel-dev-2ce7c62d1b18dca13c715c6bc2eea17f723576ff.zip
op-kernel-dev-2ce7c62d1b18dca13c715c6bc2eea17f723576ff.tar.gz
GPIO: gpio-generic: remove kfree() from bgpio_remove call
Memory for basic-mmio-gpio driver is allocated by the driver using it, whether it's the generic GPIO driver itself or another driver. In either case, the owner shall allocate and free the struct bgpio_chip it is using, preferably using a managed resource. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-generic.c')
-rw-r--r--drivers/gpio/gpio-generic.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index 42d4706..d2196bf 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -390,11 +390,7 @@ static int bgpio_setup_direction(struct bgpio_chip *bgc,
int bgpio_remove(struct bgpio_chip *bgc)
{
- int err = gpiochip_remove(&bgc->gc);
-
- kfree(bgc);
-
- return err;
+ return gpiochip_remove(&bgc->gc);
}
EXPORT_SYMBOL_GPL(bgpio_remove);
OpenPOWER on IntegriCloud