summaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro/st_gyro_buffer.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-03-25 08:58:00 +0000
committerJonathan Cameron <jic23@kernel.org>2013-03-25 21:06:09 +0000
commit1e9663c62b32f695af37fec4afc473b59f5ca9b4 (patch)
tree8f1c1c9fbaa89c3f75ad14a04dd8ee20ecb6dba0 /drivers/iio/gyro/st_gyro_buffer.c
parentc5cf4606b6659e711258b6e567415ab83a3b646c (diff)
downloadlinux-1e9663c62b32f695af37fec4afc473b59f5ca9b4.tar.bz2
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/gyro/st_gyro_buffer.c')
-rw-r--r--drivers/iio/gyro/st_gyro_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/gyro/st_gyro_buffer.c b/drivers/iio/gyro/st_gyro_buffer.c
index da4d122ec7dc..69017c7ec302 100644
--- a/drivers/iio/gyro/st_gyro_buffer.c
+++ b/drivers/iio/gyro/st_gyro_buffer.c
@@ -25,7 +25,7 @@
int st_gyro_trig_set_state(struct iio_trigger *trig, bool state)
{
- struct iio_dev *indio_dev = trig->private_data;
+ struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
return st_sensors_set_dataready_irq(indio_dev, state);
}