On Wed, Jun 12, 2019 at 4:24 AM Phil Reid <preid@xxxxxxxxxxxxxxxxx> wrote: > Currently probing of the mcp23s08 results in an error message > "detected irqchip that is shared with multiple gpiochips: > please fix the driver" > > This is due to the following: > > Call to mcp23s08_irqchip_setup() with call hierarchy: > mcp23s08_irqchip_setup() > gpiochip_irqchip_add_nested() > gpiochip_irqchip_add_key() > gpiochip_set_irq_hooks() > > Call to devm_gpiochip_add_data() with call hierarchy: > devm_gpiochip_add_data() > gpiochip_add_data_with_key() > gpiochip_add_irqchip() > gpiochip_set_irq_hooks() > > The gpiochip_add_irqchip() returns immediately if there isn't a irqchip > but we added a irqchip due to the previous mcp23s08_irqchip_setup() > call. So it calls gpiochip_set_irq_hooks() a second time. > > Fix this by moving the call to devm_gpiochip_add_data before > the call to mcp23s08_irqchip_setup > > Suggested-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx> > Signed-off-by: Phil Reid <preid@xxxxxxxxxxxxxxxxx> > --- > > Notes: > v2: > - remove unrelated whitespace changes I applied this for fixes some days back, seems my mail about it didn't make it out. Yours, Linus Walleij