Skip to content

Commit

Permalink
GPIO: gpio-generic: remove kfree() from bgpio_remove call
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Shiyan authored and Linus Walleij committed Apr 11, 2013
1 parent 7fc7acb commit 2ce7c62
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/gpio/gpio-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2ce7c62

Please sign in to comment.