From: Alexandre Belloni Date: Mon, 1 Jul 2013 14:20:00 +0000 (+0100) Subject: iio: Fix iio_channel_has_info X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8b68eefae0dbd8cdddb54af08c2b424f6da6f6ba;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git iio: Fix iio_channel_has_info commit 1c297a66654a3295ae87e2b7f3724d214eb2b5ec upstream. 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. Signed-off-by: Alexandre Belloni Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 8d171f42763..3d35b702359 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) \