drivers/iio/adc/at91_adc.c: use devm_ functions
authorJulia Lawall <Julia.Lawall@lip6.fr>
Tue, 31 Jul 2012 13:09:00 +0000 (14:09 +0100)
committerJonathan Cameron <jic23@kernel.org>
Thu, 16 Aug 2012 19:03:19 +0000 (20:03 +0100)
commit390d75c1287bf68c2e29226bf8eb10ae6a08c380
tree67b5ac8e5acfabe5c7de9bc6142bd618ace0d042
parentd16f6dbddbd7a2ac40e090da1e6bb7dd9b5a1dcb
drivers/iio/adc/at91_adc.c: use devm_ functions

The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

The call to platform_get_resource(pdev, IORESOURCE_MEM, 0) is moved coser
to the call to devm_request_and_ioremap, which is th first use of the
result of platform_get_resource.

This does not use devm_request_irq to ensure that free_irq is executed
before its idev argument is freed.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/at91_adc.c