mtd: spear_smi: use devm_ functions consistently
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 4 Aug 2012 20:36:38 +0000 (22:36 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 29 Sep 2012 14:05:32 +0000 (15:05 +0100)
commite1ed147fd4a322741e63f66d76e68ad83876d2ea
treeab857e4008a894e0ad73ddecbfb4b0bb662ad5f8
parent99f2b107924c07bee0bae7151426495fb815ca6e
mtd: spear_smi: use devm_ functions consistently

Use devm_kzalloc for all calls to kzalloc and not just the first.  Use devm
functions for other allocations as well.

Move the call to platform_get_resource(pdev, IORESOURCE_MEM, 0) closer to
where its result is passed to devm_request_and_ioremap to make the lack of
need for a NULL test more evident.

The semantic match that finds the inconsistency is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
@@

*devm_kzalloc(...)
...
*kzalloc(...)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/spear_smi.c