diff options
Diffstat (limited to 'drivers/iio/industrialio-core.c')
-rw-r--r-- | drivers/iio/industrialio-core.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 86f34600a3aa..1ddd8861c71b 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -265,7 +265,7 @@ static ssize_t iio_read_channel_ext_info(struct device *dev, | |||
265 | struct device_attribute *attr, | 265 | struct device_attribute *attr, |
266 | char *buf) | 266 | char *buf) |
267 | { | 267 | { |
268 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 268 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
269 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 269 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
270 | const struct iio_chan_spec_ext_info *ext_info; | 270 | const struct iio_chan_spec_ext_info *ext_info; |
271 | 271 | ||
@@ -279,7 +279,7 @@ static ssize_t iio_write_channel_ext_info(struct device *dev, | |||
279 | const char *buf, | 279 | const char *buf, |
280 | size_t len) | 280 | size_t len) |
281 | { | 281 | { |
282 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 282 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
283 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 283 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
284 | const struct iio_chan_spec_ext_info *ext_info; | 284 | const struct iio_chan_spec_ext_info *ext_info; |
285 | 285 | ||
@@ -293,7 +293,7 @@ static ssize_t iio_read_channel_info(struct device *dev, | |||
293 | struct device_attribute *attr, | 293 | struct device_attribute *attr, |
294 | char *buf) | 294 | char *buf) |
295 | { | 295 | { |
296 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 296 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
297 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 297 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
298 | int val, val2; | 298 | int val, val2; |
299 | bool scale_db = false; | 299 | bool scale_db = false; |
@@ -330,7 +330,7 @@ static ssize_t iio_write_channel_info(struct device *dev, | |||
330 | const char *buf, | 330 | const char *buf, |
331 | size_t len) | 331 | size_t len) |
332 | { | 332 | { |
333 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 333 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
334 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 334 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
335 | int ret, integer = 0, fract = 0, fract_mult = 100000; | 335 | int ret, integer = 0, fract = 0, fract_mult = 100000; |
336 | bool integer_part = true, negative = false; | 336 | bool integer_part = true, negative = false; |
@@ -638,7 +638,7 @@ static ssize_t iio_show_dev_name(struct device *dev, | |||
638 | struct device_attribute *attr, | 638 | struct device_attribute *attr, |
639 | char *buf) | 639 | char *buf) |
640 | { | 640 | { |
641 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 641 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
642 | return sprintf(buf, "%s\n", indio_dev->name); | 642 | return sprintf(buf, "%s\n", indio_dev->name); |
643 | } | 643 | } |
644 | 644 | ||
@@ -724,7 +724,7 @@ static void iio_device_unregister_sysfs(struct iio_dev *indio_dev) | |||
724 | 724 | ||
725 | static void iio_dev_release(struct device *device) | 725 | static void iio_dev_release(struct device *device) |
726 | { | 726 | { |
727 | struct iio_dev *indio_dev = container_of(device, struct iio_dev, dev); | 727 | struct iio_dev *indio_dev = dev_to_iio_dev(device); |
728 | cdev_del(&indio_dev->chrdev); | 728 | cdev_del(&indio_dev->chrdev); |
729 | if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) | 729 | if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) |
730 | iio_device_unregister_trigger_consumer(indio_dev); | 730 | iio_device_unregister_trigger_consumer(indio_dev); |