mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpiolib: wm8994: Convert to devm_kzalloc()
@ 2012-06-05 16:22 Mark Brown
  2012-06-07 11:07 ` Linus Walleij
  2012-07-05 12:40 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2012-06-05 16:22 UTC (permalink / raw)
  To: Grant Likely, Linus Walleij; +Cc: linux-kernel, patches, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/gpio/gpio-wm8994.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index a1c7ba9..f2b3d19 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -249,7 +249,8 @@ static int __devinit wm8994_gpio_probe(struct platform_device *pdev)
 	struct wm8994_gpio *wm8994_gpio;
 	int ret;
 
-	wm8994_gpio = kzalloc(sizeof(*wm8994_gpio), GFP_KERNEL);
+	wm8994_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm8994_gpio),
+				   GFP_KERNEL);
 	if (wm8994_gpio == NULL)
 		return -ENOMEM;
 
@@ -274,20 +275,14 @@ static int __devinit wm8994_gpio_probe(struct platform_device *pdev)
 	return ret;
 
 err:
-	kfree(wm8994_gpio);
 	return ret;
 }
 
 static int __devexit wm8994_gpio_remove(struct platform_device *pdev)
 {
 	struct wm8994_gpio *wm8994_gpio = platform_get_drvdata(pdev);
-	int ret;
-
-	ret = gpiochip_remove(&wm8994_gpio->gpio_chip);
-	if (ret == 0)
-		kfree(wm8994_gpio);
 
-	return ret;
+	return gpiochip_remove(&wm8994_gpio->gpio_chip);
 }
 
 static struct platform_driver wm8994_gpio_driver = {
-- 
1.7.10


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpiolib: wm8994: Convert to devm_kzalloc()
  2012-06-05 16:22 [PATCH] gpiolib: wm8994: Convert to devm_kzalloc() Mark Brown
@ 2012-06-07 11:07 ` Linus Walleij
  2012-07-05 12:40 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-06-07 11:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, patches

On Tue, Jun 5, 2012 at 6:22 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/gpio/gpio-wm8994.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)

Nice!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpiolib: wm8994: Convert to devm_kzalloc()
  2012-06-05 16:22 [PATCH] gpiolib: wm8994: Convert to devm_kzalloc() Mark Brown
  2012-06-07 11:07 ` Linus Walleij
@ 2012-07-05 12:40 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2012-07-05 12:40 UTC (permalink / raw)
  To: Mark Brown; +Cc: Grant Likely, Linus Walleij, linux-kernel, patches

On Tue, Jun 5, 2012 at 6:22 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:

> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
>  drivers/gpio/gpio-wm8994.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)

Patch applied.

Thanks,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-05 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-05 16:22 [PATCH] gpiolib: wm8994: Convert to devm_kzalloc() Mark Brown
2012-06-07 11:07 ` Linus Walleij
2012-07-05 12:40 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®