From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/4] staging:iio:adis16260: Fix drvdata inconsistency
Date: Sat, 14 Jul 2012 09:46:41 +0100 [thread overview]
Message-ID: <500131F1.2050200@kernel.org> (raw)
In-Reply-To: <1342181050-22579-1-git-send-email-lars@metafoo.de>
On 07/13/2012 01:04 PM, Lars-Peter Clausen wrote:
> The SPI drvdata is set to adis16260_state struct in probe(), but assumed to be
> the iio_dev struct in remove(). Fix this by setting it to the iio_dev in
> probe().
>
> The issue has been discovered using the following coccinelle patch:
>
> // <smpl>
> @r1@
> type T;
> T data;
> expression dev;
> @@
> (
> spi_set_drvdata(dev, (void *)data)
> |
> spi_set_drvdata(dev, data)
> )
>
> @r2@
> type r1.T;
> T data;
> position p;
> expression dev;
> @@
> data = spi_get_drvdata@p(dev)
>
> @depends on r1@
> position p != r2.p;
> expression dev;
> identifier data;
> @@
> *data = spi_get_drvdata@p(dev)
> // </smpl>
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
All merged to fixes-togreg.
Thanks
> ---
> drivers/staging/iio/gyro/adis16260_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/gyro/adis16260_core.c b/drivers/staging/iio/gyro/adis16260_core.c
> index f16b393..93aa431 100644
> --- a/drivers/staging/iio/gyro/adis16260_core.c
> +++ b/drivers/staging/iio/gyro/adis16260_core.c
> @@ -617,7 +617,7 @@ static int __devinit adis16260_probe(struct spi_device *spi)
> if (pd)
> st->negate = pd->negate;
> /* this is only used for removal purposes */
> - spi_set_drvdata(spi, st);
> + spi_set_drvdata(spi, indio_dev);
>
> st->us = spi;
> mutex_init(&st->buf_lock);
>
prev parent reply other threads:[~2012-07-14 8:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 12:04 [PATCH 1/4] staging:iio:adis16260: Fix drvdata inconsistency Lars-Peter Clausen
2012-07-13 12:04 ` [PATCH 2/4] staging:iio:tsl2x7x: Fix client data inconsistency Lars-Peter Clausen
2012-07-13 12:04 ` [PATCH 3/4] staging:iio:lpc32xx_adc: Ensure request_irq and free_irq dev_id parameter match Lars-Peter Clausen
2012-07-13 12:04 ` [PATCH 4/4] staging:iio:tsl2x7x: " Lars-Peter Clausen
2012-07-14 8:46 ` Jonathan Cameron [this message]
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=500131F1.2050200@kernel.org \
--to=jic23@kernel.org \
--cc=lars@metafoo.de \
--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.