diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-06-21 13:10:59 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-23 00:08:10 -0400 |
commit | 4bf8172772254a38741de139a355e36eabbb5cb8 (patch) | |
tree | 7777ff682c067c911ac208409e6601f37cdb7c43 /drivers | |
parent | 70b3fd34a9b2e06b2702d691d406ef2ec1d2f0df (diff) |
staging:iio:trigger: Use to_iio_trigger() instead of dev_get_drvdata()
Use to_iio_trigger(dev) instead of dev_get_drvdata(dev). Both will return the
trigger which belongs to the device, but the the first on is a bit more
lightweight. Also this will eventually free up the drvdata pointer of the device
for driver specific data.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-bfin-timer.c | 4 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | 4 | ||||
-rw-r--r-- | drivers/staging/iio/trigger/iio-trig-sysfs.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c index f85734d212bb..ce6a7b1b8860 100644 --- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c +++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c | |||
@@ -60,7 +60,7 @@ struct bfin_tmr_state { | |||
60 | static ssize_t iio_bfin_tmr_frequency_store(struct device *dev, | 60 | static ssize_t iio_bfin_tmr_frequency_store(struct device *dev, |
61 | struct device_attribute *attr, const char *buf, size_t count) | 61 | struct device_attribute *attr, const char *buf, size_t count) |
62 | { | 62 | { |
63 | struct iio_trigger *trig = dev_get_drvdata(dev); | 63 | struct iio_trigger *trig = to_iio_trigger(dev); |
64 | struct bfin_tmr_state *st = trig->private_data; | 64 | struct bfin_tmr_state *st = trig->private_data; |
65 | long val; | 65 | long val; |
66 | int ret; | 66 | int ret; |
@@ -97,7 +97,7 @@ static ssize_t iio_bfin_tmr_frequency_show(struct device *dev, | |||
97 | struct device_attribute *attr, | 97 | struct device_attribute *attr, |
98 | char *buf) | 98 | char *buf) |
99 | { | 99 | { |
100 | struct iio_trigger *trig = dev_get_drvdata(dev); | 100 | struct iio_trigger *trig = to_iio_trigger(dev); |
101 | struct bfin_tmr_state *st = trig->private_data; | 101 | struct bfin_tmr_state *st = trig->private_data; |
102 | 102 | ||
103 | return sprintf(buf, "%lu\n", | 103 | return sprintf(buf, "%lu\n", |
diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c index 9f2d055524a3..4ceaa18ef9f4 100644 --- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c +++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c | |||
@@ -41,7 +41,7 @@ static ssize_t iio_trig_periodic_read_freq(struct device *dev, | |||
41 | struct device_attribute *attr, | 41 | struct device_attribute *attr, |
42 | char *buf) | 42 | char *buf) |
43 | { | 43 | { |
44 | struct iio_trigger *trig = dev_get_drvdata(dev); | 44 | struct iio_trigger *trig = to_iio_trigger(dev); |
45 | struct iio_prtc_trigger_info *trig_info = trig->private_data; | 45 | struct iio_prtc_trigger_info *trig_info = trig->private_data; |
46 | return sprintf(buf, "%u\n", trig_info->frequency); | 46 | return sprintf(buf, "%u\n", trig_info->frequency); |
47 | } | 47 | } |
@@ -51,7 +51,7 @@ static ssize_t iio_trig_periodic_write_freq(struct device *dev, | |||
51 | const char *buf, | 51 | const char *buf, |
52 | size_t len) | 52 | size_t len) |
53 | { | 53 | { |
54 | struct iio_trigger *trig = dev_get_drvdata(dev); | 54 | struct iio_trigger *trig = to_iio_trigger(dev); |
55 | struct iio_prtc_trigger_info *trig_info = trig->private_data; | 55 | struct iio_prtc_trigger_info *trig_info = trig->private_data; |
56 | unsigned long val; | 56 | unsigned long val; |
57 | int ret; | 57 | int ret; |
diff --git a/drivers/staging/iio/trigger/iio-trig-sysfs.c b/drivers/staging/iio/trigger/iio-trig-sysfs.c index 552763bb3d4c..fee474648108 100644 --- a/drivers/staging/iio/trigger/iio-trig-sysfs.c +++ b/drivers/staging/iio/trigger/iio-trig-sysfs.c | |||
@@ -92,7 +92,7 @@ static struct device iio_sysfs_trig_dev = { | |||
92 | static ssize_t iio_sysfs_trigger_poll(struct device *dev, | 92 | static ssize_t iio_sysfs_trigger_poll(struct device *dev, |
93 | struct device_attribute *attr, const char *buf, size_t count) | 93 | struct device_attribute *attr, const char *buf, size_t count) |
94 | { | 94 | { |
95 | struct iio_trigger *trig = dev_get_drvdata(dev); | 95 | struct iio_trigger *trig = to_iio_trigger(dev); |
96 | iio_trigger_poll_chained(trig, 0); | 96 | iio_trigger_poll_chained(trig, 0); |
97 | 97 | ||
98 | return count; | 98 | return count; |