iio:trigger: Introduce iio_tigger_{set,get}_drvdata
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 25 Mar 2013 08:58:00 +0000 (08:58 +0000)
committerJonathan Cameron <jic23@kernel.org>
Mon, 25 Mar 2013 21:06:09 +0000 (21:06 +0000)
commit1e9663c62b32f695af37fec4afc473b59f5ca9b4
tree8f1c1c9fbaa89c3f75ad14a04dd8ee20ecb6dba0
parentc5cf4606b6659e711258b6e567415ab83a3b646c
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>
17 files changed:
drivers/iio/accel/st_accel_buffer.c
drivers/iio/adc/ad_sigma_delta.c
drivers/iio/adc/at91_adc.c
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
drivers/iio/common/st_sensors/st_sensors_trigger.c
drivers/iio/gyro/itg3200_buffer.c
drivers/iio/gyro/st_gyro_buffer.c
drivers/iio/imu/adis_trigger.c
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
drivers/staging/iio/accel/lis3l02dq_ring.c
drivers/staging/iio/adc/mxs-lradc.c
drivers/staging/iio/meter/ade7758_trigger.c
drivers/staging/iio/trigger/iio-trig-bfin-timer.c
drivers/staging/iio/trigger/iio-trig-gpio.c
drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
drivers/staging/iio/trigger/iio-trig-sysfs.c
include/linux/iio/trigger.h