Skip to content

Commit e19c6bd

Browse files
andy-shevBenjamin Tissoires
authored andcommitted
HID: cp2112: Use BIT() in GPIO setter and getter
Use BIT() in GPIO setter and getter for the sake of consistency with GENMASK() usage elsewhere in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230703185222.50554-10-andriy.shevchenko@linux.intel.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
1 parent ee0682b commit e19c6bd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hid/hid-cp2112.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
197197
goto exit;
198198
}
199199

200-
buf[1] &= ~(1 << offset);
200+
buf[1] &= ~BIT(offset);
201201
buf[2] = gpio_push_pull;
202202

203203
ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf,
@@ -228,7 +228,7 @@ static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
228228

229229
buf[0] = CP2112_GPIO_SET;
230230
buf[1] = value ? CP2112_GPIO_ALL_GPIO_MASK : 0;
231-
buf[2] = 1 << offset;
231+
buf[2] = BIT(offset);
232232

233233
ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf,
234234
CP2112_GPIO_SET_LENGTH, HID_FEATURE_REPORT,

0 commit comments

Comments
 (0)