linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix buffers registrations in order to use generic IIO trigger
@ 2013-09-18  9:00 Denis CIOCCA
  2013-09-18  9:00 ` [PATCH 1/4] iio:accel: Register buffer also without specific trigger Denis CIOCCA
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-18  9:00 UTC (permalink / raw)
  To: jic23, linux-iio; +Cc: lee.jones

Hi All,

This patches fix buffers registrations in order to use generic IIO trigger.
Thanks,

Denis

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] iio:accel: Register buffer also without specific trigger
  2013-09-18  9:00 Fix buffers registrations in order to use generic IIO trigger Denis CIOCCA
@ 2013-09-18  9:00 ` Denis CIOCCA
  2013-09-21 14:43   ` Jonathan Cameron
  2013-09-18  9:00 ` [PATCH 2/4] iio:gyro: " Denis CIOCCA
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-18  9:00 UTC (permalink / raw)
  To: jic23, linux-iio; +Cc: lee.jones, Denis Ciocca

This patch fix buffer registration that allows to use generic IIO trigger.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
---
 drivers/iio/accel/st_accel_core.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
index 1458343..1bbdc8f 100644
--- a/drivers/iio/accel/st_accel_core.c
+++ b/drivers/iio/accel/st_accel_core.c
@@ -480,13 +480,13 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
 	if (err < 0)
 		goto st_accel_common_probe_error;
 
-	if (adata->get_irq_data_ready(indio_dev) > 0) {
-		err = st_accel_allocate_ring(indio_dev);
-		if (err < 0)
-			goto st_accel_common_probe_error;
+	err = st_accel_allocate_ring(indio_dev);
+	if (err < 0)
+		goto st_accel_common_probe_error;
 
+	if (adata->get_irq_data_ready(indio_dev) > 0) {
 		err = st_sensors_allocate_trigger(indio_dev,
-						 ST_ACCEL_TRIGGER_OPS);
+							ST_ACCEL_TRIGGER_OPS);
 		if (err < 0)
 			goto st_accel_probe_trigger_error;
 	}
@@ -501,8 +501,7 @@ st_accel_device_register_error:
 	if (adata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
 st_accel_probe_trigger_error:
-	if (adata->get_irq_data_ready(indio_dev) > 0)
-		st_accel_deallocate_ring(indio_dev);
+	st_accel_deallocate_ring(indio_dev);
 st_accel_common_probe_error:
 	return err;
 }
@@ -513,10 +512,10 @@ void st_accel_common_remove(struct iio_dev *indio_dev)
 	struct st_sensor_data *adata = iio_priv(indio_dev);
 
 	iio_device_unregister(indio_dev);
-	if (adata->get_irq_data_ready(indio_dev) > 0) {
+	if (adata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
-		st_accel_deallocate_ring(indio_dev);
-	}
+
+	st_accel_deallocate_ring(indio_dev);
 }
 EXPORT_SYMBOL(st_accel_common_remove);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] iio:gyro: Register buffer also without specific trigger
  2013-09-18  9:00 Fix buffers registrations in order to use generic IIO trigger Denis CIOCCA
  2013-09-18  9:00 ` [PATCH 1/4] iio:accel: Register buffer also without specific trigger Denis CIOCCA
@ 2013-09-18  9:00 ` Denis CIOCCA
  2013-09-21 14:50   ` Jonathan Cameron
  2013-09-18  9:00 ` [PATCH 3/4] iio:magn: " Denis CIOCCA
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-18  9:00 UTC (permalink / raw)
  To: jic23, linux-iio; +Cc: lee.jones, Denis Ciocca

This patch fix buffer registration that allows to use generic IIO trigger.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
---
 drivers/iio/gyro/st_gyro_core.c |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
index e13c2b0..8a45d43 100644
--- a/drivers/iio/gyro/st_gyro_core.c
+++ b/drivers/iio/gyro/st_gyro_core.c
@@ -329,13 +329,13 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
 	if (err < 0)
 		goto st_gyro_common_probe_error;
 
-	if (gdata->get_irq_data_ready(indio_dev) > 0) {
-		err = st_gyro_allocate_ring(indio_dev);
-		if (err < 0)
-			goto st_gyro_common_probe_error;
+	err = st_gyro_allocate_ring(indio_dev);
+	if (err < 0)
+		goto st_gyro_common_probe_error;
 
+	if (gdata->get_irq_data_ready(indio_dev) > 0) {
 		err = st_sensors_allocate_trigger(indio_dev,
-						  ST_GYRO_TRIGGER_OPS);
+							ST_GYRO_TRIGGER_OPS);
 		if (err < 0)
 			goto st_gyro_probe_trigger_error;
 	}
@@ -350,8 +350,7 @@ st_gyro_device_register_error:
 	if (gdata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
 st_gyro_probe_trigger_error:
-	if (gdata->get_irq_data_ready(indio_dev) > 0)
-		st_gyro_deallocate_ring(indio_dev);
+	st_gyro_deallocate_ring(indio_dev);
 st_gyro_common_probe_error:
 	return err;
 }
@@ -362,10 +361,10 @@ void st_gyro_common_remove(struct iio_dev *indio_dev)
 	struct st_sensor_data *gdata = iio_priv(indio_dev);
 
 	iio_device_unregister(indio_dev);
-	if (gdata->get_irq_data_ready(indio_dev) > 0) {
+	if (gdata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
-		st_gyro_deallocate_ring(indio_dev);
-	}
+
+	st_gyro_deallocate_ring(indio_dev);
 }
 EXPORT_SYMBOL(st_gyro_common_remove);
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] iio:magn: Register buffer also without specific trigger
  2013-09-18  9:00 Fix buffers registrations in order to use generic IIO trigger Denis CIOCCA
  2013-09-18  9:00 ` [PATCH 1/4] iio:accel: Register buffer also without specific trigger Denis CIOCCA
  2013-09-18  9:00 ` [PATCH 2/4] iio:gyro: " Denis CIOCCA
@ 2013-09-18  9:00 ` Denis CIOCCA
  2013-09-21 14:50   ` Jonathan Cameron
  2013-09-18  9:00 ` [PATCH 4/4] iio:press: " Denis CIOCCA
  2013-09-18 11:20 ` Fix buffers registrations in order to use generic IIO trigger Lee Jones
  4 siblings, 1 reply; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-18  9:00 UTC (permalink / raw)
  To: jic23, linux-iio; +Cc: lee.jones, Denis Ciocca

This patch fix buffer registration that allows to use generic IIO trigger.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
---
 drivers/iio/magnetometer/st_magn_core.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
index e8d2849..0de49f8 100644
--- a/drivers/iio/magnetometer/st_magn_core.c
+++ b/drivers/iio/magnetometer/st_magn_core.c
@@ -372,10 +372,11 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
 	if (err < 0)
 		goto st_magn_common_probe_error;
 
+	err = st_magn_allocate_ring(indio_dev);
+	if (err < 0)
+		goto st_magn_common_probe_error;
+
 	if (mdata->get_irq_data_ready(indio_dev) > 0) {
-		err = st_magn_allocate_ring(indio_dev);
-		if (err < 0)
-			goto st_magn_common_probe_error;
 		err = st_sensors_allocate_trigger(indio_dev, NULL);
 		if (err < 0)
 			goto st_magn_probe_trigger_error;
@@ -391,8 +392,7 @@ st_magn_device_register_error:
 	if (mdata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
 st_magn_probe_trigger_error:
-	if (mdata->get_irq_data_ready(indio_dev) > 0)
-		st_magn_deallocate_ring(indio_dev);
+	st_magn_deallocate_ring(indio_dev);
 st_magn_common_probe_error:
 	return err;
 }
@@ -403,10 +403,10 @@ void st_magn_common_remove(struct iio_dev *indio_dev)
 	struct st_sensor_data *mdata = iio_priv(indio_dev);
 
 	iio_device_unregister(indio_dev);
-	if (mdata->get_irq_data_ready(indio_dev) > 0) {
+	if (mdata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
-		st_magn_deallocate_ring(indio_dev);
-	}
+
+	st_magn_deallocate_ring(indio_dev);
 }
 EXPORT_SYMBOL(st_magn_common_remove);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] iio:press: Register buffer also without specific trigger
  2013-09-18  9:00 Fix buffers registrations in order to use generic IIO trigger Denis CIOCCA
                   ` (2 preceding siblings ...)
  2013-09-18  9:00 ` [PATCH 3/4] iio:magn: " Denis CIOCCA
@ 2013-09-18  9:00 ` Denis CIOCCA
  2013-09-21 14:51   ` Jonathan Cameron
  2013-09-18 11:20 ` Fix buffers registrations in order to use generic IIO trigger Lee Jones
  4 siblings, 1 reply; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-18  9:00 UTC (permalink / raw)
  To: jic23, linux-iio; +Cc: lee.jones, Denis Ciocca

This patch fix buffer registration that allows to use generic IIO trigger.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
---
 drivers/iio/pressure/st_pressure_core.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
index 93bff9b..312a093 100644
--- a/drivers/iio/pressure/st_pressure_core.c
+++ b/drivers/iio/pressure/st_pressure_core.c
@@ -262,11 +262,11 @@ int st_press_common_probe(struct iio_dev *indio_dev,
 	if (err < 0)
 		goto st_press_common_probe_error;
 
-	if (pdata->get_irq_data_ready(indio_dev) > 0) {
-		err = st_press_allocate_ring(indio_dev);
-		if (err < 0)
-			goto st_press_common_probe_error;
+	err = st_press_allocate_ring(indio_dev);
+	if (err < 0)
+		goto st_press_common_probe_error;
 
+	if (pdata->get_irq_data_ready(indio_dev) > 0) {
 		err = st_sensors_allocate_trigger(indio_dev,
 							ST_PRESS_TRIGGER_OPS);
 		if (err < 0)
@@ -283,8 +283,7 @@ st_press_device_register_error:
 	if (pdata->get_irq_data_ready(indio_dev) > 0)
 		st_sensors_deallocate_trigger(indio_dev);
 st_press_probe_trigger_error:
-	if (pdata->get_irq_data_ready(indio_dev) > 0)
-		st_press_deallocate_ring(indio_dev);
+	st_press_deallocate_ring(indio_dev);
 st_press_common_probe_error:
 	return err;
 }
@@ -295,10 +294,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);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: Fix buffers registrations in order to use generic IIO trigger
  2013-09-18  9:00 Fix buffers registrations in order to use generic IIO trigger Denis CIOCCA
                   ` (3 preceding siblings ...)
  2013-09-18  9:00 ` [PATCH 4/4] iio:press: " Denis CIOCCA
@ 2013-09-18 11:20 ` Lee Jones
  2013-09-18 11:32   ` Denis CIOCCA
  4 siblings, 1 reply; 12+ messages in thread
From: Lee Jones @ 2013-09-18 11:20 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: jic23, linux-iio

> This patches fix buffers registrations in order to use generic IIO trigger.
> Thanks,

I don't know Jonathan would like to deal with this, but please note
that all of these patches will conflict with my patch-set.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Fix buffers registrations in order to use generic IIO trigger
  2013-09-18 11:20 ` Fix buffers registrations in order to use generic IIO trigger Lee Jones
@ 2013-09-18 11:32   ` Denis CIOCCA
  0 siblings, 0 replies; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-18 11:32 UTC (permalink / raw)
  To: Lee Jones; +Cc: jic23@kernel.org, linux-iio@vger.kernel.org

Pj4gVGhpcyBwYXRjaGVzIGZpeCBidWZmZXJzIHJlZ2lzdHJhdGlvbnMgaW4gb3JkZXIgdG8gdXNl
IGdlbmVyaWMgSUlPIHRyaWdnZXIuDQo+PiBUaGFua3MsDQo+IEkgZG9uJ3Qga25vdyBKb25hdGhh
biB3b3VsZCBsaWtlIHRvIGRlYWwgd2l0aCB0aGlzLCBidXQgcGxlYXNlIG5vdGUNCj4gdGhhdCBh
bGwgb2YgdGhlc2UgcGF0Y2hlcyB3aWxsIGNvbmZsaWN0IHdpdGggbXkgcGF0Y2gtc2V0Lg0KPg0K
SSBjYW4gcmViYXNlIHRoZSBwYXRjaGVzIHdoZW4geW91ciB3aWxsIGJlIGFwcGxpZWQhDQpJIHNl
bnQgbm93IHRoZSBtYWlsIGZvciB5b3VyIGZlZWRiYWNrLi4uDQoNClRoYW5rcw==

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] iio:accel: Register buffer also without specific trigger
  2013-09-18  9:00 ` [PATCH 1/4] iio:accel: Register buffer also without specific trigger Denis CIOCCA
@ 2013-09-21 14:43   ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2013-09-21 14:43 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: linux-iio, lee.jones

On 09/18/13 10:00, Denis CIOCCA wrote:
> This patch fix buffer registration that allows to use generic IIO trigger.
> 
> Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Applied to the togreg branch of iio.git with the tiny changes needed to make
this apply on top of Lee's patch set.

Please do take a quick look to check I didn't mess it up!

> ---
>  drivers/iio/accel/st_accel_core.c |   19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c
> index 1458343..1bbdc8f 100644
> --- a/drivers/iio/accel/st_accel_core.c
> +++ b/drivers/iio/accel/st_accel_core.c
> @@ -480,13 +480,13 @@ int st_accel_common_probe(struct iio_dev *indio_dev,
>  	if (err < 0)
>  		goto st_accel_common_probe_error;
>  
> -	if (adata->get_irq_data_ready(indio_dev) > 0) {
> -		err = st_accel_allocate_ring(indio_dev);
> -		if (err < 0)
> -			goto st_accel_common_probe_error;
> +	err = st_accel_allocate_ring(indio_dev);
> +	if (err < 0)
> +		goto st_accel_common_probe_error;
>  
> +	if (adata->get_irq_data_ready(indio_dev) > 0) {
>  		err = st_sensors_allocate_trigger(indio_dev,
> -						 ST_ACCEL_TRIGGER_OPS);
> +							ST_ACCEL_TRIGGER_OPS);
>  		if (err < 0)
>  			goto st_accel_probe_trigger_error;
>  	}
> @@ -501,8 +501,7 @@ st_accel_device_register_error:
>  	if (adata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
>  st_accel_probe_trigger_error:
> -	if (adata->get_irq_data_ready(indio_dev) > 0)
> -		st_accel_deallocate_ring(indio_dev);
> +	st_accel_deallocate_ring(indio_dev);
>  st_accel_common_probe_error:
>  	return err;
>  }
> @@ -513,10 +512,10 @@ void st_accel_common_remove(struct iio_dev *indio_dev)
>  	struct st_sensor_data *adata = iio_priv(indio_dev);
>  
>  	iio_device_unregister(indio_dev);
> -	if (adata->get_irq_data_ready(indio_dev) > 0) {
> +	if (adata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
> -		st_accel_deallocate_ring(indio_dev);
> -	}
> +
> +	st_accel_deallocate_ring(indio_dev);
>  }
>  EXPORT_SYMBOL(st_accel_common_remove);
>  
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] iio:gyro: Register buffer also without specific trigger
  2013-09-18  9:00 ` [PATCH 2/4] iio:gyro: " Denis CIOCCA
@ 2013-09-21 14:50   ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2013-09-21 14:50 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: linux-iio, lee.jones

On 09/18/13 10:00, Denis CIOCCA wrote:
> This patch fix buffer registration that allows to use generic IIO trigger.
> 
> Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Forward ported and applied to the togreg branch of iio.git

> ---
>  drivers/iio/gyro/st_gyro_core.c |   19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/gyro/st_gyro_core.c b/drivers/iio/gyro/st_gyro_core.c
> index e13c2b0..8a45d43 100644
> --- a/drivers/iio/gyro/st_gyro_core.c
> +++ b/drivers/iio/gyro/st_gyro_core.c
> @@ -329,13 +329,13 @@ int st_gyro_common_probe(struct iio_dev *indio_dev,
>  	if (err < 0)
>  		goto st_gyro_common_probe_error;
>  
> -	if (gdata->get_irq_data_ready(indio_dev) > 0) {
> -		err = st_gyro_allocate_ring(indio_dev);
> -		if (err < 0)
> -			goto st_gyro_common_probe_error;
> +	err = st_gyro_allocate_ring(indio_dev);
> +	if (err < 0)
> +		goto st_gyro_common_probe_error;
>  
> +	if (gdata->get_irq_data_ready(indio_dev) > 0) {
>  		err = st_sensors_allocate_trigger(indio_dev,
> -						  ST_GYRO_TRIGGER_OPS);
> +							ST_GYRO_TRIGGER_OPS);
>  		if (err < 0)
>  			goto st_gyro_probe_trigger_error;
>  	}
> @@ -350,8 +350,7 @@ st_gyro_device_register_error:
>  	if (gdata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
>  st_gyro_probe_trigger_error:
> -	if (gdata->get_irq_data_ready(indio_dev) > 0)
> -		st_gyro_deallocate_ring(indio_dev);
> +	st_gyro_deallocate_ring(indio_dev);
>  st_gyro_common_probe_error:
>  	return err;
>  }
> @@ -362,10 +361,10 @@ void st_gyro_common_remove(struct iio_dev *indio_dev)
>  	struct st_sensor_data *gdata = iio_priv(indio_dev);
>  
>  	iio_device_unregister(indio_dev);
> -	if (gdata->get_irq_data_ready(indio_dev) > 0) {
> +	if (gdata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
> -		st_gyro_deallocate_ring(indio_dev);
> -	}
> +
> +	st_gyro_deallocate_ring(indio_dev);
>  }
>  EXPORT_SYMBOL(st_gyro_common_remove);
>  
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/4] iio:magn: Register buffer also without specific trigger
  2013-09-18  9:00 ` [PATCH 3/4] iio:magn: " Denis CIOCCA
@ 2013-09-21 14:50   ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2013-09-21 14:50 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: linux-iio, lee.jones

On 09/18/13 10:00, Denis CIOCCA wrote:
> This patch fix buffer registration that allows to use generic IIO trigger.
> 
> Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Forward ported and applied to the togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/magnetometer/st_magn_core.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index e8d2849..0de49f8 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -372,10 +372,11 @@ int st_magn_common_probe(struct iio_dev *indio_dev,
>  	if (err < 0)
>  		goto st_magn_common_probe_error;
>  
> +	err = st_magn_allocate_ring(indio_dev);
> +	if (err < 0)
> +		goto st_magn_common_probe_error;
> +
>  	if (mdata->get_irq_data_ready(indio_dev) > 0) {
> -		err = st_magn_allocate_ring(indio_dev);
> -		if (err < 0)
> -			goto st_magn_common_probe_error;
>  		err = st_sensors_allocate_trigger(indio_dev, NULL);
>  		if (err < 0)
>  			goto st_magn_probe_trigger_error;
> @@ -391,8 +392,7 @@ st_magn_device_register_error:
>  	if (mdata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
>  st_magn_probe_trigger_error:
> -	if (mdata->get_irq_data_ready(indio_dev) > 0)
> -		st_magn_deallocate_ring(indio_dev);
> +	st_magn_deallocate_ring(indio_dev);
>  st_magn_common_probe_error:
>  	return err;
>  }
> @@ -403,10 +403,10 @@ void st_magn_common_remove(struct iio_dev *indio_dev)
>  	struct st_sensor_data *mdata = iio_priv(indio_dev);
>  
>  	iio_device_unregister(indio_dev);
> -	if (mdata->get_irq_data_ready(indio_dev) > 0) {
> +	if (mdata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
> -		st_magn_deallocate_ring(indio_dev);
> -	}
> +
> +	st_magn_deallocate_ring(indio_dev);
>  }
>  EXPORT_SYMBOL(st_magn_common_remove);
>  
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] iio:press: Register buffer also without specific trigger
  2013-09-18  9:00 ` [PATCH 4/4] iio:press: " Denis CIOCCA
@ 2013-09-21 14:51   ` Jonathan Cameron
  2013-09-23 10:53     ` Denis CIOCCA
  0 siblings, 1 reply; 12+ messages in thread
From: Jonathan Cameron @ 2013-09-21 14:51 UTC (permalink / raw)
  To: Denis CIOCCA; +Cc: linux-iio, lee.jones

On 09/18/13 10:00, Denis CIOCCA wrote:
> This patch fix buffer registration that allows to use generic IIO trigger.
> 
> Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Forward ported and applied to the togreg branch of iio.git  Thanks,

Please do confirm I didn't do anything silly, but the port to the code
Lee updated seemed trivial so I'd rather do it and clear the patches
out of my queue ;)

> ---
>  drivers/iio/pressure/st_pressure_core.c |   17 ++++++++---------
>  1 file changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
> index 93bff9b..312a093 100644
> --- a/drivers/iio/pressure/st_pressure_core.c
> +++ b/drivers/iio/pressure/st_pressure_core.c
> @@ -262,11 +262,11 @@ int st_press_common_probe(struct iio_dev *indio_dev,
>  	if (err < 0)
>  		goto st_press_common_probe_error;
>  
> -	if (pdata->get_irq_data_ready(indio_dev) > 0) {
> -		err = st_press_allocate_ring(indio_dev);
> -		if (err < 0)
> -			goto st_press_common_probe_error;
> +	err = st_press_allocate_ring(indio_dev);
> +	if (err < 0)
> +		goto st_press_common_probe_error;
>  
> +	if (pdata->get_irq_data_ready(indio_dev) > 0) {
>  		err = st_sensors_allocate_trigger(indio_dev,
>  							ST_PRESS_TRIGGER_OPS);
>  		if (err < 0)
> @@ -283,8 +283,7 @@ st_press_device_register_error:
>  	if (pdata->get_irq_data_ready(indio_dev) > 0)
>  		st_sensors_deallocate_trigger(indio_dev);
>  st_press_probe_trigger_error:
> -	if (pdata->get_irq_data_ready(indio_dev) > 0)
> -		st_press_deallocate_ring(indio_dev);
> +	st_press_deallocate_ring(indio_dev);
>  st_press_common_probe_error:
>  	return err;
>  }
> @@ -295,10 +294,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);
>  
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] iio:press: Register buffer also without specific trigger
  2013-09-21 14:51   ` Jonathan Cameron
@ 2013-09-23 10:53     ` Denis CIOCCA
  0 siblings, 0 replies; 12+ messages in thread
From: Denis CIOCCA @ 2013-09-23 10:53 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio@vger.kernel.org, lee.jones@linaro.org

Thanks Jonathan!

all is fine...;)

Denis


> On 09/18/13 10:00, Denis CIOCCA wrote:
>> This patch fix buffer registration that allows to use generic IIO trigger.
>>
>> Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
> Forward ported and applied to the togreg branch of iio.git  Thanks,
>
> Please do confirm I didn't do anything silly, but the port to the code
> Lee updated seemed trivial so I'd rather do it and clear the patches
> out of my queue ;)
>
>> ---
>>   drivers/iio/pressure/st_pressure_core.c |   17 ++++++++---------
>>   1 file changed, 8 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/iio/pressure/st_pressure_core.c b/drivers/iio/pressure/st_pressure_core.c
>> index 93bff9b..312a093 100644
>> --- a/drivers/iio/pressure/st_pressure_core.c
>> +++ b/drivers/iio/pressure/st_pressure_core.c
>> @@ -262,11 +262,11 @@ int st_press_common_probe(struct iio_dev *indio_dev,
>>   	if (err < 0)
>>   		goto st_press_common_probe_error;
>>   
>> -	if (pdata->get_irq_data_ready(indio_dev) > 0) {
>> -		err = st_press_allocate_ring(indio_dev);
>> -		if (err < 0)
>> -			goto st_press_common_probe_error;
>> +	err = st_press_allocate_ring(indio_dev);
>> +	if (err < 0)
>> +		goto st_press_common_probe_error;
>>   
>> +	if (pdata->get_irq_data_ready(indio_dev) > 0) {
>>   		err = st_sensors_allocate_trigger(indio_dev,
>>   							ST_PRESS_TRIGGER_OPS);
>>   		if (err < 0)
>> @@ -283,8 +283,7 @@ st_press_device_register_error:
>>   	if (pdata->get_irq_data_ready(indio_dev) > 0)
>>   		st_sensors_deallocate_trigger(indio_dev);
>>   st_press_probe_trigger_error:
>> -	if (pdata->get_irq_data_ready(indio_dev) > 0)
>> -		st_press_deallocate_ring(indio_dev);
>> +	st_press_deallocate_ring(indio_dev);
>>   st_press_common_probe_error:
>>   	return err;
>>   }
>> @@ -295,10 +294,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);
>>   
>>

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-23 10:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-18  9:00 Fix buffers registrations in order to use generic IIO trigger Denis CIOCCA
2013-09-18  9:00 ` [PATCH 1/4] iio:accel: Register buffer also without specific trigger Denis CIOCCA
2013-09-21 14:43   ` Jonathan Cameron
2013-09-18  9:00 ` [PATCH 2/4] iio:gyro: " Denis CIOCCA
2013-09-21 14:50   ` Jonathan Cameron
2013-09-18  9:00 ` [PATCH 3/4] iio:magn: " Denis CIOCCA
2013-09-21 14:50   ` Jonathan Cameron
2013-09-18  9:00 ` [PATCH 4/4] iio:press: " Denis CIOCCA
2013-09-21 14:51   ` Jonathan Cameron
2013-09-23 10:53     ` Denis CIOCCA
2013-09-18 11:20 ` Fix buffers registrations in order to use generic IIO trigger Lee Jones
2013-09-18 11:32   ` Denis CIOCCA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).