aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/industrialio-buffer.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index a7ac4b5af03e..58180ec36fe8 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -243,6 +243,8 @@ static int iio_buffer_add_channel_sysfs(struct iio_dev *indio_dev,
243 0, 243 0,
244 &indio_dev->dev, 244 &indio_dev->dev,
245 &buffer->scan_el_dev_attr_list); 245 &buffer->scan_el_dev_attr_list);
246 if (ret)
247 goto error_ret;
246 attrcount++; 248 attrcount++;
247 ret = attrcount; 249 ret = attrcount;
248error_ret: 250error_ret:
@@ -412,7 +414,7 @@ ssize_t iio_buffer_show_enable(struct device *dev,
412} 414}
413EXPORT_SYMBOL(iio_buffer_show_enable); 415EXPORT_SYMBOL(iio_buffer_show_enable);
414 416
415/* note NULL used as error indicator as it doesn't make sense. */ 417/* Note NULL used as error indicator as it doesn't make sense. */
416static const unsigned long *iio_scan_mask_match(const unsigned long *av_masks, 418static const unsigned long *iio_scan_mask_match(const unsigned long *av_masks,
417 unsigned int masklength, 419 unsigned int masklength,
418 const unsigned long *mask) 420 const unsigned long *mask)
@@ -494,7 +496,7 @@ int iio_update_buffers(struct iio_dev *indio_dev,
494 return 0; 496 return 0;
495 } 497 }
496 498
497 /* What scan mask do we actually have ?*/ 499 /* What scan mask do we actually have? */
498 compound_mask = kcalloc(BITS_TO_LONGS(indio_dev->masklength), 500 compound_mask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
499 sizeof(long), GFP_KERNEL); 501 sizeof(long), GFP_KERNEL);
500 if (compound_mask == NULL) { 502 if (compound_mask == NULL) {
@@ -560,7 +562,7 @@ int iio_update_buffers(struct iio_dev *indio_dev,
560 goto error_run_postdisable; 562 goto error_run_postdisable;
561 } 563 }
562 } 564 }
563 /* Definitely possible for devices to support both of these.*/ 565 /* Definitely possible for devices to support both of these. */
564 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) { 566 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) {
565 if (!indio_dev->trig) { 567 if (!indio_dev->trig) {
566 printk(KERN_INFO "Buffer not started: no trigger\n"); 568 printk(KERN_INFO "Buffer not started: no trigger\n");
@@ -571,7 +573,7 @@ int iio_update_buffers(struct iio_dev *indio_dev,
571 indio_dev->currentmode = INDIO_BUFFER_TRIGGERED; 573 indio_dev->currentmode = INDIO_BUFFER_TRIGGERED;
572 } else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) { 574 } else if (indio_dev->modes & INDIO_BUFFER_HARDWARE) {
573 indio_dev->currentmode = INDIO_BUFFER_HARDWARE; 575 indio_dev->currentmode = INDIO_BUFFER_HARDWARE;
574 } else { /* should never be reached */ 576 } else { /* Should never be reached */
575 ret = -EINVAL; 577 ret = -EINVAL;
576 goto error_run_postdisable; 578 goto error_run_postdisable;
577 } 579 }
@@ -694,6 +696,7 @@ static bool iio_validate_scan_mask(struct iio_dev *indio_dev,
694 696
695/** 697/**
696 * iio_scan_mask_set() - set particular bit in the scan mask 698 * iio_scan_mask_set() - set particular bit in the scan mask
699 * @indio_dev: the iio device
697 * @buffer: the buffer whose scan mask we are interested in 700 * @buffer: the buffer whose scan mask we are interested in
698 * @bit: the bit to be set. 701 * @bit: the bit to be set.
699 * 702 *
@@ -714,7 +717,7 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
714 if (trialmask == NULL) 717 if (trialmask == NULL)
715 return -ENOMEM; 718 return -ENOMEM;
716 if (!indio_dev->masklength) { 719 if (!indio_dev->masklength) {
717 WARN_ON("trying to set scanmask prior to registering buffer\n"); 720 WARN_ON("Trying to set scanmask prior to registering buffer\n");
718 goto err_invalid_mask; 721 goto err_invalid_mask;
719 } 722 }
720 bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength); 723 bitmap_copy(trialmask, buffer->scan_mask, indio_dev->masklength);