diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-03-25 09:58:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-03-25 22:06:09 +0100 |
commit | 1e9663c62b32f695af37fec4afc473b59f5ca9b4 (patch) | |
tree | 8f1c1c9fbaa89c3f75ad14a04dd8ee20ecb6dba0 /drivers/iio/imu/adis_trigger.c | |
parent | staging: comedi: s626: remove MC_DISABLE macro (diff) | |
download | linux-1e9663c62b32f695af37fec4afc473b59f5ca9b4.tar.xz linux-1e9663c62b32f695af37fec4afc473b59f5ca9b4.zip |
iio:trigger: Introduce iio_tigger_{set,get}_drvdata
Introduce iio_tigger_{set,get}_drvdata which allows to attach driver specific
data to a trigger. The functions wrap access to the triggers private_data field
and all current users are updated to use iio_tigger_{set,get}_drvdata instead of
directly accessing the private_data field. This is the first step towards
removing the private_data field from the iio_trigger struct.
The following coccinelle script has been used to update the drivers:
<smpl>
@@
struct iio_trigger *trigger;
expression priv;
@@
-trigger->private_data = priv
+iio_trigger_set_drv_data(trigger, priv)
@@
struct iio_trigger *trigger;
@@
-trigger->private_data
+iio_trigger_get_drv_data(trigger)
</smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu/adis_trigger.c')
-rw-r--r-- | drivers/iio/imu/adis_trigger.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c index 5a24c9cac343..e0017c22bb9c 100644 --- a/drivers/iio/imu/adis_trigger.c +++ b/drivers/iio/imu/adis_trigger.c @@ -19,7 +19,7 @@ static int adis_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) { - struct adis *adis = trig->private_data; + struct adis *adis = iio_trigger_get_drvdata(trig); return adis_enable_irq(adis, state); } @@ -57,7 +57,7 @@ int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev) adis->trig->dev.parent = &adis->spi->dev; adis->trig->ops = &adis_trigger_ops; - adis->trig->private_data = adis; + iio_trigger_set_drvdata(adis->trig, adis); ret = iio_trigger_register(adis->trig); indio_dev->trig = adis->trig; |