mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
pinctrl: mcp23s08: fix irq setup order
When using mcp23s08 module with gpio-keys, often (50% of boots) it fails to get irq numbers with message: "gpio-keys keys: Unable to get irq number for GPIO 0, error -6". Seems that irqs must be setup before devm_gpiochip_add_data(). Cc: stable@vger.kernel.org Signed-off-by: Dmitry Mastykin <mastichi@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
d3452f1d88
commit
02e389e63e
1 changed files with 4 additions and 4 deletions
|
@ -890,16 +890,16 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = devm_gpiochip_add_data(dev, &mcp->chip, mcp);
|
|
||||||
if (ret < 0)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
if (mcp->irq && mcp->irq_controller) {
|
if (mcp->irq && mcp->irq_controller) {
|
||||||
ret = mcp23s08_irq_setup(mcp);
|
ret = mcp23s08_irq_setup(mcp);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = devm_gpiochip_add_data(dev, &mcp->chip, mcp);
|
||||||
|
if (ret < 0)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
mcp->pinctrl_desc.name = "mcp23xxx-pinctrl";
|
mcp->pinctrl_desc.name = "mcp23xxx-pinctrl";
|
||||||
mcp->pinctrl_desc.pctlops = &mcp_pinctrl_ops;
|
mcp->pinctrl_desc.pctlops = &mcp_pinctrl_ops;
|
||||||
mcp->pinctrl_desc.confops = &mcp_pinconf_ops;
|
mcp->pinctrl_desc.confops = &mcp_pinconf_ops;
|
||||||
|
|
Loading…
Reference in a new issue