staging:iio:adc:ad7606 make gpio request failures more consistent
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 30 Sep 2011 09:05:40 +0000 (10:05 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 3 Oct 2011 23:07:04 +0000 (16:07 -0700)
commit68b41aefa30d9b8713d1c255080863e611a5a226
tree858ae273725d0b224d00322c0ad927f619e66033
parent0b89525dfcb8b90b5992d6de1433aa04b0a04b3a
staging:iio:adc:ad7606 make gpio request failures more consistent

To my mind, if a gpio is specified in the board file, yet fails
to be successfully requested, that is an error condidtion and
the driver should not muddle on regardless.

This does mean unwinding the gpios on error. Also the free_gpios
function is reordered so that it is consistent with the request one
(reverse order obviously).

This patch is the category of not technically fixing anything, just
making the driver be more in line with what a reviewer will expect.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/adc/ad7606.h
drivers/staging/iio/adc/ad7606_core.c
drivers/staging/iio/adc/ad7606_ring.c