aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-buffer.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-23 00:29:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-23 00:29:20 -0400
commit8b425aa193439a2b60a988a9230f1de753e36902 (patch)
tree05854e1d5bc19cfe25a782b2cc919ba5519cb8ef /drivers/iio/industrialio-buffer.c
parenta798c10faf62a505d24e5f6213fbaf904a39623f (diff)
parente036f71e8ce310dc58b1351c3eb967b892f4641c (diff)
Merge tag 'iio-fixes-for-3.15a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: First found of IIO fixes for the 3.15 cycle. * Fix the platform data support for the at91 adc driver. * A couple of related follow up patches get the support working again for at91sam9260 and at91sam9g45 as the earlier patch results in a device name change. * A default timer value in the at91 adc driver was bonkers. Make it sane. * Fix incorrect reporting of the integration time for the cm32181 light sensor * Fix a missing break in the ad2s1200 driver which would have give a false error return. * Make sure buffer scan mask queries from userspace return 0/1 rather than a fairly random value depending on their implementation of test_bit * Fix leak of the i2c client and a null pointer dereference in the cm36651 driver. * Fix a build warning on avr32 for the mxs-lradc (not exactly a critical combination - but the issue was real).
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
-rw-r--r--drivers/iio/industrialio-buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index e108f2a9d827..e472cff6eeae 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -165,7 +165,8 @@ static ssize_t iio_scan_el_show(struct device *dev,
165 int ret; 165 int ret;
166 struct iio_dev *indio_dev = dev_to_iio_dev(dev); 166 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
167 167
168 ret = test_bit(to_iio_dev_attr(attr)->address, 168 /* Ensure ret is 0 or 1. */
169 ret = !!test_bit(to_iio_dev_attr(attr)->address,
169 indio_dev->buffer->scan_mask); 170 indio_dev->buffer->scan_mask);
170 171
171 return sprintf(buf, "%d\n", ret); 172 return sprintf(buf, "%d\n", ret);
@@ -862,7 +863,8 @@ int iio_scan_mask_query(struct iio_dev *indio_dev,
862 if (!buffer->scan_mask) 863 if (!buffer->scan_mask)
863 return 0; 864 return 0;
864 865
865 return test_bit(bit, buffer->scan_mask); 866 /* Ensure return value is 0 or 1. */
867 return !!test_bit(bit, buffer->scan_mask);
866}; 868};
867EXPORT_SYMBOL_GPL(iio_scan_mask_query); 869EXPORT_SYMBOL_GPL(iio_scan_mask_query);
868 870