Title: [8816] trunk/drivers/staging/iio/adc/max1363_ring.c: Staging: iio: max1363 Fix two bugs in single_channel_from_ring
- Revision
- 8816
- Author
- vapier
- Date
- 2010-05-23 00:28:33 -0400 (Sun, 23 May 2010)
Log Message
Staging: iio: max1363 Fix two bugs in single_channel_from_ring
From: Jonathan Cameron <[email protected]>
This patch contains fixes for the two bugs Michael pointed
out last week. As the other suggestion Michael made is
not a bug fix (just a much more sensible way of handling
things), I'll do that as a separate patch soon.
The bugs were introduced with the abi changes.
Modified Paths
Diff
Modified: trunk/drivers/staging/iio/adc/max1363_ring.c (8815 => 8816)
--- trunk/drivers/staging/iio/adc/max1363_ring.c 2010-05-23 04:28:09 UTC (rev 8815)
+++ trunk/drivers/staging/iio/adc/max1363_ring.c 2010-05-23 04:28:33 UTC (rev 8816)
@@ -51,15 +51,15 @@
/* Need a count of channels prior to this one */
mask >>= 1;
while (mask) {
- if (mask && st->current_mode->modemask)
+ if (mask & st->current_mode->modemask)
count++;
mask >>= 1;
}
if (st->chip_info->bits != 8)
- return ((int)(ring_data[count*2 + 0] & 0x0F) << 8)
+ ret = ((int)(ring_data[count*2 + 0] & 0x0F) << 8)
+ (int)(ring_data[count*2 + 1]);
else
- return ring_data[count];
+ ret = ring_data[count];
error_free_ring_data:
kfree(ring_data);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits