summaryrefslogtreecommitdiffstats
path: root/drivers/iio/common
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-09-16 17:02:00 +0100
committerJonathan Cameron <jic23@kernel.org>2013-09-21 19:24:04 +0100
commitcaf5ca122b6b4c2da62949538604f1dabe6f34e8 (patch)
treeed5613425042e374cb97a17acd31d13ef8496ac8 /drivers/iio/common
parentefd9566ff8aef07d89d9ee530b65b38dad3b8eb9 (diff)
downloadop-kernel-dev-caf5ca122b6b4c2da62949538604f1dabe6f34e8.zip
op-kernel-dev-caf5ca122b6b4c2da62949538604f1dabe6f34e8.tar.gz
iio: sensors-core: st: Clean-up error handling in st_sensors_read_axis_data()
Gets rid of those unnecessary gotos. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r--drivers/iio/common/st_sensors/st_sensors_core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/iio/common/st_sensors/st_sensors_core.c b/drivers/iio/common/st_sensors/st_sensors_core.c
index 32a56fd..7ba1ef2 100644
--- a/drivers/iio/common/st_sensors/st_sensors_core.c
+++ b/drivers/iio/common/st_sensors/st_sensors_core.c
@@ -331,10 +331,8 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
unsigned int byte_for_channel = ch->scan_type.storagebits >> 3;
outdata = kmalloc(byte_for_channel, GFP_KERNEL);
- if (!outdata) {
- err = -EINVAL;
- goto st_sensors_read_axis_data_error;
- }
+ if (!outdata)
+ return -ENOMEM;
err = sdata->tf->read_multiple_byte(&sdata->tb, sdata->dev,
ch->address, byte_for_channel,
@@ -349,7 +347,7 @@ static int st_sensors_read_axis_data(struct iio_dev *indio_dev,
st_sensors_free_memory:
kfree(outdata);
-st_sensors_read_axis_data_error:
+
return err;
}
OpenPOWER on IntegriCloud