Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 97271c3b authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron
Browse files

staging:iio:adis16260: Fix drvdata inconsistency



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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 2b6e6b80
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment