forked from Minki/linux
bfb7971c30
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> |
||
---|---|---|
.. | ||
leds-sead3.c | ||
Makefile | ||
Platform | ||
sead3-console.c | ||
sead3-display.c | ||
sead3-ehci.c | ||
sead3-i2c-dev.c | ||
sead3-i2c-drv.c | ||
sead3-i2c.c | ||
sead3-init.c | ||
sead3-int.c | ||
sead3-lcd.c | ||
sead3-leds.c | ||
sead3-mtd.c | ||
sead3-net.c | ||
sead3-pic32-bus.c | ||
sead3-pic32-i2c-drv.c | ||
sead3-platform.c | ||
sead3-reset.c | ||
sead3-serial.c | ||
sead3-setup.c | ||
sead3-time.c | ||
sead3.dts |