pinctrl: cs42l43: Fix leaked pm reference on error path
Charles Keepax
maintainerPATCH 1/2 pinctrl: cs42l43: Fix leaked pm reference on error path
Returning directly if the regmap_update_bits() fails causes a pm runtime reference to be leaked, let things run to the end of the function instead.
--- drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pinctrl/cirrus/pinctrl-cs42l43.c +1 -3
@@ -499,12 +499,10 @@ static int cs42l43_gpio_set(struct gpio_chip *chip, unsigned int offset, ret =regmap_update_bits (priv->regmap,CS42L43_GPIO_CTRL1 ,BIT (shift), value << shift); -if (ret) -return ret;pm_runtime_put (priv->dev); -return 0 ; +return ret; } static int cs42l43_gpio_direction_out(struct gpio_chip *chip,
Signature · 1 line
2.47.3
Charles Keepax
maintainerPATCH 2/2 pinctrl: cs42l43: Fix polarity on debounce
The debounce bit sets a bypass on the debounce rather than enabling it, as such the current polarity of the debounce is set incorrectly. Invert the polarity to correct this.
--- drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/cirrus/pinctrl-cs42l43.c +1 -1
@@ -343,7 +343,7 @@ static int cs42l43_pin_set_db(struct cs42l43_pin *priv, unsigned int pin,return regmap_update_bits (priv->regmap,CS42L43_GPIO_CTRL2 ,CS42L43_GPIO1_DEGLITCH_BYP_MASK << pin, - !!us << pin); + !us << pin); } static int cs42l43_pin_config_get(struct pinctrl_dev *pctldev,
Signature · 1 line
2.47.3
Re: [PATCH 2/2] pinctrl: cs42l43: Fix polarity on debounce
Quoted 24 lines · Charles Keepax
The debounce bit sets a bypass on the debounce rather than enabling it, as such the current polarity of the debounce is set incorrectly. Invert the polarity to correct this.
Fixes d5282a539297 ("pinctrl: cs42l43: Add support for the cs42l43")Signed-off-by Charles Keepax <[email protected]>--- drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/cirrus/pinctrl-cs42l43.c +1
-2@@ -343,7 +343,7 @@ static int cs42l43_pin_set_db(struct cs42l43_pin *priv, unsigned int pin,return regmap_update_bits (priv->regmap,CS42L43_GPIO_CTRL2 ,CS42L43_GPIO1_DEGLITCH_BYP_MASK << pin, - !!us << pin); + !us << pin); } static int cs42l43_pin_config_get(struct pinctrl_dev *pctldev, --
Quoted 3 lines
2.47.3
Linus Walleij
maintainerRe: [PATCH 2/2] pinctrl: cs42l43: Fix polarity on debounce
In reply to Charles KeepaxQuoted 6 lines · Charles Keepax
The debounce bit sets a bypass on the debounce rather than enabling it, as such the current polarity of the debounce is set incorrectly. Invert the polarity to correct this.
Fixes d5282a539297 ("pinctrl: cs42l43: Add support for the cs42l43")Signed-off-by Charles Keepax <[email protected]>
Patch applied!
Yours,
Linus Walleij
Quoted 29 lines · Charles Keepax
Returning directly if the
regmap_update_bits()fails causes a pm runtime reference to be leaked, let things run to the end of the function instead.Fixes e52c741907fb ("pinctrl: cirrus: cs42l43: use new GPIO line value setter callbacks")Signed-off-by Charles Keepax <[email protected]>--- drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/pinctrl/cirrus/pinctrl-cs42l43.c +1
-4@@ -499,12 +499,10 @@ static int cs42l43_gpio_set(struct gpio_chip *chip, unsigned int offset, ret =regmap_update_bits (priv->regmap,CS42L43_GPIO_CTRL1 ,BIT (shift), value << shift); -if (ret) -return ret;pm_runtime_put (priv->dev); -return 0 ; +return ret; } static int cs42l43_gpio_direction_out(struct gpio_chip *chip, --
Quoted 3 lines
2.47.3
Linus Walleij
maintainerQuoted 6 lines · Charles Keepax
Returning directly if the
regmap_update_bits()fails causes a pm runtime reference to be leaked, let things run to the end of the function instead.Fixes e52c741907fb ("pinctrl: cirrus: cs42l43: use new GPIO line value setter callbacks")Signed-off-by Charles Keepax <[email protected]>
Patch applied!
Yours,
Linus Walleij