Skip to content

Commit 56e380c

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: cy8c95x0: Lock register accesses in cy8c95x0_set_mux()
It seems that cy8c95x0_set_mux() missed serialization of IO access. And its implementation looks half-baked. Add locking to the function. Fixes: e6cbbe4 ("pinctrl: Add Cypress cy8c95x0 support") Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 35b871f commit 56e380c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/pinctrl/pinctrl-cy8c95x0.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,8 +1152,13 @@ static int cy8c95x0_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
11521152
unsigned int group)
11531153
{
11541154
struct cy8c95x0_pinctrl *chip = pinctrl_dev_get_drvdata(pctldev);
1155+
int ret;
11551156

1156-
return cy8c95x0_pinmux_cfg(chip, selector, group);
1157+
mutex_lock(&chip->i2c_lock);
1158+
ret = cy8c95x0_pinmux_cfg(chip, selector, group);
1159+
mutex_unlock(&chip->i2c_lock);
1160+
1161+
return ret;
11571162
}
11581163

11591164
static const struct pinmux_ops cy8c95x0_pmxops = {

0 commit comments

Comments
 (0)