summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDenis CIOCCA <denis.ciocca@st.com>2013-09-18 09:00:00 (GMT)
committerJonathan Cameron <jic23@kernel.org>2013-09-21 18:24:09 (GMT)
commit7a137c9c40784e7be0a44182ed6ebc5ea22d5ac1 (patch)
tree88550d57bd53de01f80a4adb96090b8d7c385862 /drivers
parentf60b12b02ec8d9057863423c6d7b27169638e1d9 (diff)
downloadlinux-7a137c9c40784e7be0a44182ed6ebc5ea22d5ac1.tar.xz
iio:press: Register buffer also without specific trigger
This patch fix buffer registration that allows to use generic IIO trigger. Signed-off-by: Denis Ciocca <denis.ciocca@st.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/pressure/st_pressure_core.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index e879542..2da411b 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -349,11 +349,11 @@ int st_press_common_probe(struct iio_dev *indio_dev,
if (err < 0)
return err;
- if (irq > 0) {
- err = st_press_allocate_ring(indio_dev);
- if (err < 0)
- return err;
+ err = st_press_allocate_ring(indio_dev);
+ if (err < 0)
+ return err;
+ if (irq > 0) {
err = st_sensors_allocate_trigger(indio_dev,
ST_PRESS_TRIGGER_OPS);
if (err < 0)
@@ -370,8 +370,7 @@ st_press_device_register_error:
if (irq > 0)
st_sensors_deallocate_trigger(indio_dev);
st_press_probe_trigger_error:
- if (irq > 0)
- st_press_deallocate_ring(indio_dev);
+ st_press_deallocate_ring(indio_dev);
return err;
}
@@ -382,10 +381,10 @@ void st_press_common_remove(struct iio_dev *indio_dev)
struct st_sensor_data *pdata = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
- if (pdata->get_irq_data_ready(indio_dev) > 0) {
+ if (pdata->get_irq_data_ready(indio_dev) > 0)
st_sensors_deallocate_trigger(indio_dev);
- st_press_deallocate_ring(indio_dev);
- }
+
+ st_press_deallocate_ring(indio_dev);
}
EXPORT_SYMBOL(st_press_common_remove);