From 8e3829c61b489933e58f671ac111a2f1980563d4 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Tue, 7 Aug 2012 08:55:00 +0100 Subject: [PATCH] staging:iio:adis16220: Use kobj_to_dev instead of open-coding it Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- drivers/staging/iio/accel/adis16220_core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c index 575f1af25d5d..c31e1ec2e66a 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, -- 2.20.1