diff options
author | Nadim almas <nadim.902@gmail.com> | 2016-11-02 17:28:45 +0530 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-11-13 17:45:01 +0800 |
commit | 650d4a978271850278466ba7222bcfc893ce9542 (patch) | |
tree | 61639d583edc27532489e09f57d2bd737640e5ea /crypto | |
parent | 4d9b3a5b93800d5eb6939a7e363dc82d4439da0b (diff) | |
download | linux-stable-650d4a978271850278466ba7222bcfc893ce9542.tar.gz linux-stable-650d4a978271850278466ba7222bcfc893ce9542.tar.bz2 linux-stable-650d4a978271850278466ba7222bcfc893ce9542.zip |
Crypto: mv_cesa - Switch to using managed resources
Switch to resource-managed function devm_kzalloc instead
of kzalloc and remove unneeded kfree
Also, remove kfree in probe function and remove
function, mv_remove as it is now has nothing to do.
The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@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 prb.e;
@@
removefn(...) {
<...
- kfree(e);
...>
}
//</smpl>
Signed-off-by: Nadim Almas <nadim.902@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions