summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-74xx-mmio.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-07-19 01:02:52 +0300
committerBartosz Golaszewski <brgl@bgdev.pl>2022-07-19 11:14:49 +0300
commit28ba057456412794198ba6c953aa2042147c2de5 (patch)
treefb832c60cdbb947dfccd9d2174c21348f62f7d77 /drivers/gpio/gpio-74xx-mmio.c
parentd3054ba1db6270e14245efa28dbd1cf10207d4f2 (diff)
downloadlinux-28ba057456412794198ba6c953aa2042147c2de5.tar.xz
gpio: 74xx-mmio: use bits.h macros for all masks
Make use of the GENMASK() (far less error-prone, far more concise). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpio-74xx-mmio.c')
-rw-r--r--drivers/gpio/gpio-74xx-mmio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
index b2cc8a55c257..cd399898ed12 100644
--- a/drivers/gpio/gpio-74xx-mmio.c
+++ b/drivers/gpio/gpio-74xx-mmio.c
@@ -5,6 +5,7 @@
* Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
*/
+#include <linux/bits.h>
#include <linux/err.h>
#include <linux/gpio/driver.h>
#include <linux/mod_devicetable.h>
@@ -14,7 +15,7 @@
#define MMIO_74XX_DIR_IN (0 << 8)
#define MMIO_74XX_DIR_OUT (1 << 8)
-#define MMIO_74XX_BIT_CNT(x) ((x) & 0xff)
+#define MMIO_74XX_BIT_CNT(x) ((x) & GENMASK(7, 0))
struct mmio_74xx_gpio_priv {
struct gpio_chip gc;