All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Denis CIOCCA <denis.ciocca@st.com>
Cc: linux-iio@vger.kernel.org, lee.jones@linaro.org
Subject: Re: [PATCH 2/4] iio:gyro: Register buffer also without specific trigger
Date: Sat, 21 Sep 2013 15:50:29 +0100	[thread overview]
Message-ID: <523DB235.2070406@kernel.org> (raw)
In-Reply-To: <1379494822-9985-3-git-send-email-denis.ciocca@st.com>

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);
>  
> 

  reply	other threads:[~2013-09-21 13:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523DB235.2070406@kernel.org \
    --to=jic23@kernel.org \
    --cc=denis.ciocca@st.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.