]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commite7e1bd6650eec364475f947a0bf6210648cd72ab
tree8f1c1c9fbaa89c3f75ad14a04dd8ee20ecb6dba0
parent5f52d11a81473645346d9db8546fea6cb7620638
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