From: Jonathan Cameron <jic23@kernel.org>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH 6/6] iio: accel: kxcjk-1013: Increment ref counter for indio_dev->trig
Date: Sun, 20 Jul 2014 16:39:16 +0100 [thread overview]
Message-ID: <53CBE2A4.6080709@kernel.org> (raw)
In-Reply-To: <1405557754-19601-6-git-send-email-srinivas.pandruvada@linux.intel.com>
On 17/07/14 01:42, Srinivas Pandruvada wrote:
> Assigning indio_dev->trig is not a good idea, as this can result in
> wrong reference count for trigger device. If assigned, it is better to
> increment reference counter by calling iio_trigger_get.
> Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
> with Jonathan.
>
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
I've parked the intervening patches to allow time for the runtime pm one
to sit on the list.
This one is a bug fix (and should have been earlier in the series!).
I've applied it to the togreg branch of iio.git.
Lars is of course correct that we could do this in a nicer fashion, but
I'd rather get the simple fix in place and tidy up later, than delay it
now.
Jonathan
> ---
> drivers/iio/accel/kxcjk-1013.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index f5bb682..40ecf8b 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -1020,6 +1020,7 @@ static int kxcjk1013_probe(struct i2c_client *client,
> iio_trigger_set_drvdata(trig, indio_dev);
> data->trig = trig;
> indio_dev->trig = trig;
> + iio_trigger_get(indio_dev->trig);
>
> ret = iio_trigger_register(trig);
> if (ret)
>
next prev parent reply other threads:[~2014-07-20 15:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 0:42 [PATCH 1/6] iio: accel: kxcjk-1013: Fix setting frequency Srinivas Pandruvada
2014-07-17 0:42 ` [PATCH 2/6] iio: accel: kxcjk-1013: Use try_reenable to ack intr Srinivas Pandruvada
2014-07-20 15:20 ` Jonathan Cameron
2014-07-17 0:42 ` [PATCH 3/6] iio: accel: kxcjk-1013: support runtime pm Srinivas Pandruvada
2014-07-20 15:37 ` Jonathan Cameron
2014-07-22 1:23 ` Rafael J. Wysocki
2014-07-27 13:42 ` Jonathan Cameron
2014-07-27 14:26 ` Srinivas Pandruvada
2014-07-17 0:42 ` [PATCH 4/6] iio: accel: kxcjk-1013: Set adjustable range Srinivas Pandruvada
2014-07-20 15:45 ` Jonathan Cameron
2014-07-24 23:04 ` Srinivas Pandruvada
2014-07-27 13:51 ` Jonathan Cameron
2014-07-17 0:42 ` [PATCH 5/6] iio: accel: kxcjk-1013: Support thresholds Srinivas Pandruvada
2014-07-20 16:04 ` Jonathan Cameron
2014-07-20 16:34 ` Srinivas Pandruvada
2014-07-20 17:01 ` Jonathan Cameron
2014-07-17 0:42 ` [PATCH 6/6] iio: accel: kxcjk-1013: Increment ref counter for indio_dev->trig Srinivas Pandruvada
2014-07-20 11:29 ` Lars-Peter Clausen
2014-07-20 12:24 ` Jonathan Cameron
2014-07-20 15:39 ` Jonathan Cameron [this message]
2014-07-20 15:19 ` [PATCH 1/6] iio: accel: kxcjk-1013: Fix setting frequency Jonathan Cameron
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=53CBE2A4.6080709@kernel.org \
--to=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/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.