summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-08-12 17:08:38 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 13:31:06 -0700
commitd29f73db791098179af90e6a5b1df41f941b32cd (patch)
treef3ec1496873807ae7f2a6bc7158a782798fe857a /drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
parent214320b6ec0de0f98b5f929a1738363872b0178d (diff)
staging:iio:triggers introduce iio_trigger_ops to take const bits out of iio_trig_structure.
Right now this results in increased code, but I still think it is worth doing to avoid replication across instances of drivers etc and move as much stuff as possible to constant. Ops structure is optional for the occasional driver that uses none of it (currently only the ad7793). Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/trigger/iio-trig-periodic-rtc.c')
-rw-r--r--drivers/staging/iio/trigger/iio-trig-periodic-rtc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
index 01cf7e20b515..d35d085da949 100644
--- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
+++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c
@@ -96,6 +96,11 @@ static void iio_prtc_trigger_poll(void *private_data)
iio_trigger_poll(private_data, 0);
}
+static const struct iio_trigger_ops iio_prtc_trigger_ops = {
+ .owner = THIS_MODULE,
+ .set_trigger_state = &iio_trig_periodic_rtc_set_state,
+};
+
static int iio_trig_periodic_rtc_probe(struct platform_device *dev)
{
char **pdata = dev->dev.platform_data;
@@ -121,7 +126,7 @@ static int iio_trig_periodic_rtc_probe(struct platform_device *dev)
}
trig->private_data = trig_info;
trig->owner = THIS_MODULE;
- trig->set_trigger_state = &iio_trig_periodic_rtc_set_state;
+ trig->ops = &iio_prtc_trigger_ops;
/* RTC access */
trig_info->rtc
= rtc_class_open(pdata[i]);