diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-09-18 05:56:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-09-22 10:13:33 +0100 |
commit | 3183bac16f537503eb3177773781d6d3059ad7b1 (patch) | |
tree | 26f62b097ad2e9b554e68ed4280fa5f445c5d7f0 /drivers/mfd/da9052-spi.c | |
parent | 801c4b5ca373c4cfe78912616d68e1f7fd84110c (diff) | |
download | talos-obmc-linux-3183bac16f537503eb3177773781d6d3059ad7b1.tar.gz talos-obmc-linux-3183bac16f537503eb3177773781d6d3059ad7b1.zip |
iio: inkern: clean up error return code
When the IIO consumer tries to get specific IIO channel,
few error cases can be happened.
(a) Memory allocation failure
(b) No matched ADC channel error
(c) Invalid input arguments
This patch enables cleaning up error handling in case of (a) and (b).
In error handling code,
(a): the reference count of the IIO device should be decreased.
(b): the allocated memory should be freed with restoring the reference count.
Therefore iio_deivce_put() is called in both cases.
This can be handled in the last error statement.
Additionally, integer variable is used for stating each error case explicitly.
Then, the error returns as ERR_PTR() with this value.
Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/mfd/da9052-spi.c')
0 files changed, 0 insertions, 0 deletions