diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-05-19 18:55:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-21 22:29:52 +0200 |
commit | 12b5c38f2dee5981c318171805fa62f2cd7475b3 (patch) | |
tree | 27a88d8c38f5a8b9096d56f42cb05329eb7bcd62 /drivers/net/ethernet/neterion | |
parent | atm: idt77252: Remove redundant error check (diff) | |
download | linux-12b5c38f2dee5981c318171805fa62f2cd7475b3.tar.xz linux-12b5c38f2dee5981c318171805fa62f2cd7475b3.zip |
ieee802154: Introduce the use of the 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. An explicit linux/device.h include is added to make sure
the devm_*() routine declarations are unambiguously available.
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>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/neterion')
0 files changed, 0 insertions, 0 deletions