diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-08-07 07:55:00 (GMT) |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-08-14 19:27:41 (GMT) |
commit | 8e3829c61b489933e58f671ac111a2f1980563d4 (patch) | |
tree | d2f54cea977a9b5456b014381d30f35eeecf8bb2 /drivers/staging/iio/accel | |
parent | 0959c63f11c3bbef0a7d6c5011be8d25503f547c (diff) | |
download | linux-8e3829c61b489933e58f671ac111a2f1980563d4.tar.xz |
staging:iio:adis16220: Use kobj_to_dev instead of open-coding it
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/accel')
-rw-r--r-- | drivers/staging/iio/accel/adis16220_core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c index 575f1af..c31e1ec 100644 --- a/drivers/staging/iio/accel/adis16220_core.c +++ b/drivers/staging/iio/accel/adis16220_core.c @@ -372,8 +372,7 @@ static ssize_t adis16220_accel_bin_read(struct file *filp, struct kobject *kobj, loff_t off, size_t count) { - struct device *dev = container_of(kobj, struct device, kobj); - struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct iio_dev *indio_dev = dev_to_iio_dev(kobj_to_dev(kobj)); return adis16220_capture_buffer_read(indio_dev, buf, off, count, @@ -394,8 +393,7 @@ static ssize_t adis16220_adc1_bin_read(struct file *filp, struct kobject *kobj, char *buf, loff_t off, size_t count) { - struct device *dev = container_of(kobj, struct device, kobj); - struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct iio_dev *indio_dev = dev_to_iio_dev(kobj_to_dev(kobj)); return adis16220_capture_buffer_read(indio_dev, buf, off, count, @@ -416,8 +414,7 @@ static ssize_t adis16220_adc2_bin_read(struct file *filp, struct kobject *kobj, char *buf, loff_t off, size_t count) { - struct device *dev = container_of(kobj, struct device, kobj); - struct iio_dev *indio_dev = dev_to_iio_dev(dev); + struct iio_dev *indio_dev = dev_to_iio_dev(kobj_to_dev(kobj)); return adis16220_capture_buffer_read(indio_dev, buf, off, count, |