diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-09-02 21:26:49 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2022-09-08 11:06:15 +0300 |
commit | 9540a8360673350526615e1dfe4993ba06de0f15 (patch) | |
tree | a6a14b5236d8cf0e0fbac8d258d22f89988f2169 /drivers/pinctrl/pinctrl-cy8c95x0.c | |
parent | 785b1bd8546eb0d9e70bd4d859583c33aaceeb9b (diff) | |
download | linux-9540a8360673350526615e1dfe4993ba06de0f15.tar.xz |
pinctrl: cy8c95x0: 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>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20220902182650.83098-16-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-cy8c95x0.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-cy8c95x0.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c index a42790950182..c8f86c3f526f 100644 --- a/drivers/pinctrl/pinctrl-cy8c95x0.c +++ b/drivers/pinctrl/pinctrl-cy8c95x0.c @@ -374,14 +374,14 @@ static bool cy8c95x0_precious_register(struct device *dev, unsigned int reg) } static const struct reg_default cy8c95x0_reg_defaults[] = { - { CY8C95X0_OUTPUT_(0), 0xff }, - { CY8C95X0_OUTPUT_(1), 0xff }, - { CY8C95X0_OUTPUT_(2), 0xff }, - { CY8C95X0_OUTPUT_(3), 0xff }, - { CY8C95X0_OUTPUT_(4), 0xff }, - { CY8C95X0_OUTPUT_(5), 0xff }, - { CY8C95X0_OUTPUT_(6), 0xff }, - { CY8C95X0_OUTPUT_(7), 0xff }, + { CY8C95X0_OUTPUT_(0), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(1), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(2), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(3), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(4), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(5), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(6), GENMASK(7, 0) }, + { CY8C95X0_OUTPUT_(7), GENMASK(7, 0) }, { CY8C95X0_PORTSEL, 0 }, { CY8C95X0_PWMSEL, 0 }, }; @@ -1268,7 +1268,7 @@ static int cy8c95x0_detect(struct i2c_client *client, ret = i2c_smbus_read_byte_data(client, CY8C95X0_DEVID); if (ret < 0) return ret; - switch (ret & 0xf0) { + switch (ret & GENMASK(7, 4)) { case 0x20: name = cy8c95x0_id[0].name; break; |