linux-stable/drivers/platform
Himangi Saraogi 14627e3612 ix86/mid/thermal: 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.

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: Matthew Garrett <matthew.garrett@nebula.com>
2014-06-10 19:11:07 -04:00
..
chrome platform/chrome: unregister platform driver/device when module exit 2013-11-26 20:18:07 -08:00
goldfish goldfish: pipe: fix warnings for 32bit builds 2014-05-16 11:32:51 -07:00
olpc drivers/platform/olpc/olpc-ec.c: initialise earlier 2013-08-23 09:51:22 -07:00
x86 ix86/mid/thermal: Introduce the use of the managed version of kzalloc 2014-06-10 19:11:07 -04:00
Kconfig platform: add chrome platform directory 2013-11-20 18:51:03 -05:00
Makefile platform: add chrome platform directory 2013-11-20 18:51:03 -05:00