arch/arm/mach-omap1/dma.c: Invert calls to platform_device_put and platform_device_del
commit77f7059a329fc8a514bbcc2f204aaa7c150e8046
authorJulia Lawall <julia@diku.dk>
Fri, 13 May 2011 16:46:10 +0000 (13 18:46 +0200)
committerTony Lindgren <tony@atomide.com>
Wed, 1 Jun 2011 09:25:04 +0000 (1 02:25 -0700)
treea75f324b69a310e5e240e4f6cdec76b3b78e9b1f
parent30ebad9d756a0b2c97c6c4ca6c5e6b799e3b64da
arch/arm/mach-omap1/dma.c: Invert calls to platform_device_put and platform_device_del

Platform_device_del should be called before platform_device_put, as
platform_device_put can delete the structure.

Additionally, improve the error handling code for the call to ioremap, so
that it calls platform_device_put.

The semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2;
@@

*platform_device_put(e1);
... when != e1 = e2
*platform_device_del(e1);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/dma.c