Skip to content

Commit ef0e75a

Browse files
committed
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
2 parents a291ab2 + f259f89 commit ef0e75a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/pinctrl/pinctrl-mcp23s08.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,14 @@ static int mcp23s08_irq_setup(struct mcp23s08 *mcp)
636636
return err;
637637
}
638638

639+
return 0;
640+
}
641+
642+
static int mcp23s08_irqchip_setup(struct mcp23s08 *mcp)
643+
{
644+
struct gpio_chip *chip = &mcp->chip;
645+
int err;
646+
639647
err = gpiochip_irqchip_add_nested(chip,
640648
&mcp23s08_irq_chip,
641649
0,
@@ -912,7 +920,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
912920
}
913921

914922
if (mcp->irq && mcp->irq_controller) {
915-
ret = mcp23s08_irq_setup(mcp);
923+
ret = mcp23s08_irqchip_setup(mcp);
916924
if (ret)
917925
goto fail;
918926
}
@@ -944,6 +952,9 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
944952
goto fail;
945953
}
946954

955+
if (mcp->irq)
956+
ret = mcp23s08_irq_setup(mcp);
957+
947958
fail:
948959
if (ret < 0)
949960
dev_dbg(dev, "can't setup chip %d, --> %d\n", addr, ret);

0 commit comments

Comments
 (0)