diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-05-20 20:15:37 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-05-22 01:02:27 +0200 |
commit | e8cba3cda44e1b042a64ab43d15d4d77c2038235 (patch) | |
tree | 6af1bb362281982527c8c58dee1e8013581b8ef9 /ipc | |
parent | hwmon: Driver for NCT6683D (diff) | |
download | linux-e8cba3cda44e1b042a64ab43d15d4d77c2038235.tar.xz linux-e8cba3cda44e1b042a64ab43d15d4d77c2038235.zip |
hwmon: (ultra45_env) Introduce managed version of kzalloc
This patch moves data allocated using kzalloc to managed data allocated
using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
functions. Also, the unnecessary label out_free is removed.
The following Coccinelle semantic patch was used for making the change:
@platform@
identifier p, probefn, removefn;
@@
struct platform_driver p = {
.probe = probefn,
.remove = removefn,
};
@prb@
identifier platform.probefn, pdev;
expression e, e1, e2;
@@
probefn(struct platform_device *pdev, ...) {
<+...
- e = kzalloc(e1, e2)
+ e = devm_kzalloc(&pdev->dev, e1, e2)
...
?-kfree(e);
...+>
}
@rem depends on prb@
identifier platform.removefn;
expression e;
@@
removefn(...) {
<...
- kfree(e);
...>
}
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions