Skip to content

Commit

Permalink
Merge tag 'pinctrl-v4.19-5' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
Greg Kroah-Hartman committed Oct 12, 2018
2 parents a291ab2 + f259f89 commit ef0e75a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/pinctrl/pinctrl-mcp23s08.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
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,
&mcp23s08_irq_chip,
0,
Expand Down Expand Up @@ -912,7 +920,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
}

if (mcp->irq && mcp->irq_controller) {
ret = mcp23s08_irq_setup(mcp);
ret = mcp23s08_irqchip_setup(mcp);
if (ret)
goto fail;
}
Expand Down Expand Up @@ -944,6 +952,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
goto fail;
}

if (mcp->irq)
ret = mcp23s08_irq_setup(mcp);

fail:
if (ret < 0)
dev_dbg(dev, "can't setup chip %d, --> %d\n", addr, ret);
Expand Down

0 comments on commit ef0e75a

Please sign in to comment.