projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
808c513
)
gpio: adp5520: use devm_kzalloc()
author
Jingoo Han
<jg1.han@samsung.com>
Fri, 15 Mar 2013 09:14:01 +0000
(18:14 +0900)
committer
Linus Walleij
<linus.walleij@linaro.org>
Wed, 27 Mar 2013 15:05:10 +0000
(16:05 +0100)
Use devm_kzalloc() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-adp5520.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpio-adp5520.c
b/drivers/gpio/gpio-adp5520.c
index 8afa95f831b1a0f7e6caad5cbfcbeb4147018b53..f33f78dcadaad817ed331c40daa0447d126282a6 100644
(file)
--- a/
drivers/gpio/gpio-adp5520.c
+++ b/
drivers/gpio/gpio-adp5520.c
@@
-105,7
+105,7
@@
static int adp5520_gpio_probe(struct platform_device *pdev)
return -ENODEV;
}
- dev =
kzalloc(
sizeof(*dev), GFP_KERNEL);
+ dev =
devm_kzalloc(&pdev->dev,
sizeof(*dev), GFP_KERNEL);
if (dev == NULL) {
dev_err(&pdev->dev, "failed to alloc memory\n");
return -ENOMEM;
@@
-163,7
+163,6
@@
static int adp5520_gpio_probe(struct platform_device *pdev)
return 0;
err:
- kfree(dev);
return ret;
}
@@
-180,7
+179,6
@@
static int adp5520_gpio_remove(struct platform_device *pdev)
return ret;
}
- kfree(dev);
return 0;
}