* [PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call
@ 2013-04-11 17:23 Alexander Shiyan
2013-04-11 17:35 ` Linus Walleij
2013-04-11 17:38 ` Re[2]: " Alexander Shiyan
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2013-04-11 17:23 UTC (permalink / raw)
To: linux-arm-kernel
Memory for basic-mmio-gpio driver is allocated by resource managed
function, so using kfree() call in bgpio_remove is wrong.
This patch eliminates this kfree() call.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/gpio/gpio-generic.c | 6 +-----
1 file changed, 1 insertion(+), 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);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call
2013-04-11 17:23 [PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call Alexander Shiyan
@ 2013-04-11 17:35 ` Linus Walleij
2013-04-11 17:38 ` Re[2]: " Alexander Shiyan
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2013-04-11 17:35 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Apr 11, 2013 at 7:23 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
> Memory for basic-mmio-gpio driver is allocated by resource managed
> function, so using kfree() call in bgpio_remove is wrong.
> This patch eliminates this kfree() call.
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
So I think the patch is correct but the commit message is wrong.
It is not certain at all that bgpio is resource managed, but the point
of the patch should be that it's up to the driver using it to allocate
and free its struct bgpio_chip, after calling this function.
A quick glance on the consumers gives at hand that this is the case
for all consumers, so I took the liberty to update the commit
message and apply it...
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re[2]: [PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call
2013-04-11 17:23 [PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call Alexander Shiyan
2013-04-11 17:35 ` Linus Walleij
@ 2013-04-11 17:38 ` Alexander Shiyan
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Shiyan @ 2013-04-11 17:38 UTC (permalink / raw)
To: linux-arm-kernel
> On Thu, Apr 11, 2013 at 7:23 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
>
> > Memory for basic-mmio-gpio driver is allocated by resource managed
> > function, so using kfree() call in bgpio_remove is wrong.
> > This patch eliminates this kfree() call.
> >
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>
> So I think the patch is correct but the commit message is wrong.
>
> It is not certain at all that bgpio is resource managed, but the point
> of the patch should be that it's up to the driver using it to allocate
> and free its struct bgpio_chip, after calling this function.
>
> A quick glance on the consumers gives at hand that this is the case
> for all consumers, so I took the liberty to update the commit
> message and apply it...
OK, no problem.
---
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-11 17:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 17:23 [PATCH] GPIO: gpio-generic: Remove kfree() from bgpio_remove call Alexander Shiyan
2013-04-11 17:35 ` Linus Walleij
2013-04-11 17:38 ` Re[2]: " Alexander Shiyan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.