Commit ef0e75a4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Linus writes:
  "pin control fix for v4.19:

   A single pin control fix for v4.19:
   - Interrupt setup in the MCP23S08 driver."

* tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: mcp23s08: fix irq and irqchip setup order
parents a291ab2d f259f896
...@@ -636,6 +636,14 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp) ...@@ -636,6 +636,14 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
return err; return err;
} }
return 0;
}
static int mcp23s08_irqchip_setup(struct mcp23s08 *mcp)
{
struct gpio_chip *chip = &mcp->chip;
int err;
err = gpiochip_irqchip_add_nested(chip, err = gpiochip_irqchip_add_nested(chip,
&mcp23s08_irq_chip, &mcp23s08_irq_chip,
0, 0,
...@@ -912,7 +920,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -912,7 +920,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
} }
if (mcp->irq && mcp->irq_controller) { if (mcp->irq && mcp->irq_controller) {
ret = mcp23s08_irq_setup(mcp); ret = mcp23s08_irqchip_setup(mcp);
if (ret) if (ret)
goto fail; goto fail;
} }
...@@ -944,6 +952,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -944,6 +952,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
goto fail; goto fail;
} }
if (mcp->irq)
ret = mcp23s08_irq_setup(mcp);
fail: fail:
if (ret < 0) if (ret < 0)
dev_dbg(dev, "can't setup chip %d, --> %d\n", addr, ret); dev_dbg(dev, "can't setup chip %d, --> %d\n", addr, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment