]> git.baikalelectronics.ru Git - kernel.git/commitdiff
media: i2c: video-i2c: Use GENMASK for masking bits
authorMoses Christopher Bollavarapu <mosescb.dev@gmail.com>
Tue, 19 Apr 2022 20:20:51 +0000 (22:20 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 17 May 2022 07:16:49 +0000 (09:16 +0200)
Replace 0x0380 with GENMASK(9, 7) to obtain 0b0000_0011_1000_0000

Signed-off-by: Moses Christopher Bollavarapu <mosescb.dev@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/video-i2c.c

index 1d5f48329cb2ae0190c8d9f95c9a9d1c6cc4a51b..e08e3579c0a1533eea5197e7afc28fea8ed8a257 100644 (file)
@@ -9,6 +9,7 @@
  * - Melexis MLX90640 Thermal Cameras
  */
 
+#include <linux/bits.h>
 #include <linux/delay.h>
 #include <linux/freezer.h>
 #include <linux/hwmon.h>
@@ -62,7 +63,7 @@
 
 /* Control register */
 #define MLX90640_REG_CTL1              0x800d
-#define MLX90640_REG_CTL1_MASK         0x0380
+#define MLX90640_REG_CTL1_MASK         GENMASK(9, 7)
 #define MLX90640_REG_CTL1_MASK_SHIFT   7
 
 struct video_i2c_chip;