GPIO: gpio-generic: remove kfree() from bgpio_remove call
authorAlexander Shiyan <shc_work@mail.ru>
Thu, 11 Apr 2013 17:23:22 +0000 (21:23 +0400)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 11 Apr 2013 17:33:54 +0000 (19:33 +0200)
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>
drivers/gpio/gpio-generic.c

index 42d470632aea1c865766cbef39b005532fb13864..d2196bf738471fff1de061a2bbbeafee95b444f3 100644 (file)
@@ -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);