linux/drivers/sbus/char
Himangi Saraogi 57a4a3d7f7 display7seg: 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 header file is added to make the devm function explicitly
available.

The following Coccinelle semantic patch was used for making a part of
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>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-21 21:37:05 -07:00
..
Kconfig drivers/sbus/char: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:39:03 -08:00
Makefile sparc: Kill sbus mostek RTC driver. 2008-09-03 15:55:32 -07:00
bbc_envctrl.c of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
bbc_i2c.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
bbc_i2c.h of/device: Replace struct of_device with struct platform_device 2010-08-06 09:25:50 -06:00
display7seg.c display7seg: Introduce the use of the managed version of kzalloc 2014-07-21 21:37:05 -07:00
envctrl.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
flash.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00
jsflash.c jsflash: missed conversion from rq->buffer to bio_data(rq->bio) 2014-04-16 14:15:25 -06:00
max1617.h Fix common misspellings 2011-03-31 11:26:23 -03:00
openprom.c drivers/sbus/char: removes unnecessary semicolon 2012-09-21 12:08:56 -07:00
uctrl.c sparc: delete non-required instances of include <linux/init.h> 2014-01-28 23:38:23 -08:00