summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2013-07-01 16:20:00 +0200
committerJonathan Cameron <jic23@kernel.org>2013-07-02 23:08:20 +0200
commit1c297a66654a3295ae87e2b7f3724d214eb2b5ec (patch)
tree4016e4bde46063b837cf2b8095dc95399f2f6461
parentiio:trigger: device_unregister->device_del to avoid double free (diff)
downloadlinux-1c297a66654a3295ae87e2b7f3724d214eb2b5ec.tar.xz
linux-1c297a66654a3295ae87e2b7f3724d214eb2b5ec.zip
iio: Fix iio_channel_has_info
Since the info_mask split, iio_channel_has_info() is not working correctly. info_mask_separate and info_mask_shared_by_type, it is not possible to compare them directly with the iio_chan_info_enum enum. Correct that bit using the BIT() macro. Cc: <stable@vger.kernel.org> # 3.10.x Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--include/linux/iio/iio.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 8d171f427632..3d35b7023591 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -211,8 +211,8 @@ struct iio_chan_spec {
static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
enum iio_chan_info_enum type)
{
- return (chan->info_mask_separate & type) |
- (chan->info_mask_shared_by_type & type);
+ return (chan->info_mask_separate & BIT(type)) |
+ (chan->info_mask_shared_by_type & BIT(type));
}
#define IIO_ST(si, rb, sb, sh) \