diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-07-03 21:52:19 +0300 |
---|---|---|
committer | Benjamin Tissoires <bentiss@kernel.org> | 2023-07-28 17:05:48 +0200 |
commit | e19c6bd4e3760a37c59808da1ee3e7dd799348ae (patch) | |
tree | fcbe8e972f2b06962ba2ee517dbc7991d6af47cc /drivers/hid/hid-cp2112.c | |
parent | ee0682b0f241e35c3775f77acf71b20cf4d6830e (diff) | |
download | lwn-e19c6bd4e3760a37c59808da1ee3e7dd799348ae.tar.gz lwn-e19c6bd4e3760a37c59808da1ee3e7dd799348ae.zip |
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>
Diffstat (limited to 'drivers/hid/hid-cp2112.c')
-rw-r--r-- | drivers/hid/hid-cp2112.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c index 37ed7fc54770..2eebb2b19501 100644 --- a/drivers/hid/hid-cp2112.c +++ b/drivers/hid/hid-cp2112.c @@ -197,7 +197,7 @@ static int cp2112_gpio_direction_input(struct gpio_chip *chip, unsigned offset) goto exit; } - buf[1] &= ~(1 << offset); + buf[1] &= ~BIT(offset); buf[2] = gpio_push_pull; 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) buf[0] = CP2112_GPIO_SET; buf[1] = value ? CP2112_GPIO_ALL_GPIO_MASK : 0; - buf[2] = 1 << offset; + buf[2] = BIT(offset); ret = hid_hw_raw_request(hdev, CP2112_GPIO_SET, buf, CP2112_GPIO_SET_LENGTH, HID_FEATURE_REPORT, |