Skip to content

Commit

Permalink
staging:iio:adis16220: Use kobj_to_dev instead of open-coding it
Browse files Browse the repository at this point in the history
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Aug 14, 2012
1 parent 0959c63 commit 8e3829c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/staging/iio/accel/adis16220_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 8e3829c

Please sign in to comment.