提交 6da33dbd 编写于 作者: D Dan Carpenter 提交者: Linus Walleij

pinctrl: abx500: fix bitwise AND test

The intent here was to test if the bit was set or not but there is a
logical vs bitwise AND typo so it is true if any bits are set.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 a8a364bd
...@@ -426,7 +426,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, ...@@ -426,7 +426,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip,
ret = abx500_gpio_set_bits(chip, ret = abx500_gpio_set_bits(chip,
AB8500_GPIO_ALTFUN_REG, AB8500_GPIO_ALTFUN_REG,
af.alt_bit2, af.alt_bit2,
!!(af.alta_val && BIT(1))); !!(af.alta_val & BIT(1)));
} else } else
ret = abx500_gpio_set_bits(chip, AB8500_GPIO_SEL1_REG, ret = abx500_gpio_set_bits(chip, AB8500_GPIO_SEL1_REG,
offset, 1); offset, 1);
...@@ -447,7 +447,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, ...@@ -447,7 +447,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip,
ret = abx500_gpio_set_bits(chip, ret = abx500_gpio_set_bits(chip,
AB8500_GPIO_ALTFUN_REG, AB8500_GPIO_ALTFUN_REG,
af.alt_bit2, af.alt_bit2,
!!(af.altb_val && BIT(1))); !!(af.altb_val & BIT(1)));
break; break;
case ABX500_ALT_C: case ABX500_ALT_C:
...@@ -457,7 +457,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip, ...@@ -457,7 +457,7 @@ static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip,
goto out; goto out;
ret = abx500_gpio_set_bits(chip, AB8500_GPIO_ALTFUN_REG, ret = abx500_gpio_set_bits(chip, AB8500_GPIO_ALTFUN_REG,
af.alt_bit2, !!(af.altc_val && BIT(0))); af.alt_bit2, !!(af.altc_val & BIT(0)));
if (ret < 0) if (ret < 0)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册