linux/arch/mips/mti-sead3
Himangi Saraogi bfb7971c30 MIPS: SEAD3: 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. Also, the now unnecessary labels out_mem and out are done
away with. The error handling code is moved under if and return 0 is now
at the end of the function.

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>
Tested-by: Markos Chandras <markos.chandras@imgtec.com>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/6977/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2014-05-26 16:06:35 +02:00
..
leds-sead3.c MIPS: sead3: Use generic suspend/resume for LEDs. 2013-05-08 12:30:09 +02:00
Makefile MIPS: sead3: allow cmdline/env to change memory size using memsize param 2014-01-23 13:02:36 +01:00
Platform MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-console.c MIPS: FW: sead3: Use new common FW library variable processing. 2013-05-08 12:30:09 +02:00
sead3-display.c MIPS: FW: Remove obsolete header file for MTI platforms. 2013-05-08 12:30:10 +02:00
sead3-ehci.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-i2c-dev.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-i2c-drv.c MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sead3-i2c.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-init.c MIPS: microMIPS: Add support for exception handling. 2013-05-09 17:55:18 +02:00
sead3-int.c MIPS: Move 'gic_present' to common location. 2013-05-09 17:55:20 +02:00
sead3-lcd.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-leds.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-mtd.c MIPS: SEAD3: Don't use module_init in non-modular sead3-mtd.c code 2014-03-31 18:17:12 +02:00
sead3-net.c MIPS: Whitespace cleanup. 2013-02-01 10:00:22 +01:00
sead3-pic32-bus.c mips: delete non-required instances of include <linux/init.h> 2014-01-24 22:39:56 +01:00
sead3-pic32-i2c-drv.c MIPS: SEAD3: Introduce the use of the managed version of kzalloc 2014-05-26 16:06:35 +02:00
sead3-platform.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-reset.c MIPS: sead3: Fix ability to perform a soft reset. 2013-06-21 18:07:01 +02:00
sead3-serial.c MIPS: Add core files for MIPS SEAD-3 development platform. 2012-09-13 15:43:46 -05:00
sead3-setup.c MIPS: sead3: use unflatten_and_copy_device_tree() 2014-01-23 13:02:36 +01:00
sead3-time.c MIPS: sead3: remove unused cpu_khz variable 2014-01-23 13:02:35 +01:00
sead3.dts MIPS: sead3: remove chosen node 2014-01-23 13:02:36 +01:00