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 1/4] iio:accel: Register buffer also without specific trigger
Date: Sat, 21 Sep 2013 15:43:08 +0100 [thread overview]
Message-ID: <523DB07C.3030008@kernel.org> (raw)
In-Reply-To: <1379494822-9985-2-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>
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);
>
>
next prev parent reply other threads:[~2013-09-21 13:42 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 [this message]
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
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=523DB07C.3030008@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 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).