On Thu, Jun 04, 2020 at 03:28:17AM +0300, Dmitry Baryshkov wrote: > Fix the following warnings caused by reusage of the same irq_chip > instance for all spmi-gpio gpio_irq_chip instances. Instead embed > irq_chip into pmic_gpio_state struct. > > gpio gpiochip2: (c440000.qcom,spmi:pmic@2:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver. > gpio gpiochip3: (c440000.qcom,spmi:pmic@4:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver. > gpio gpiochip4: (c440000.qcom,spmi:pmic@a:gpio@c000): detected irqchip that is shared with multiple gpiochips: please fix the driver. > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> Thanks, Mani > --- > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > index fe0be8a6ebb7..092a48e4dff5 100644 > --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > @@ -170,6 +170,7 @@ struct pmic_gpio_state { > struct regmap *map; > struct pinctrl_dev *ctrl; > struct gpio_chip chip; > + struct irq_chip irq; > }; > > static const struct pinconf_generic_params pmic_gpio_bindings[] = { > @@ -917,16 +918,6 @@ static int pmic_gpio_populate(struct pmic_gpio_state *state, > return 0; > } > > -static struct irq_chip pmic_gpio_irq_chip = { > - .name = "spmi-gpio", > - .irq_ack = irq_chip_ack_parent, > - .irq_mask = irq_chip_mask_parent, > - .irq_unmask = irq_chip_unmask_parent, > - .irq_set_type = irq_chip_set_type_parent, > - .irq_set_wake = irq_chip_set_wake_parent, > - .flags = IRQCHIP_MASK_ON_SUSPEND, > -}; > - > static int pmic_gpio_domain_translate(struct irq_domain *domain, > struct irq_fwspec *fwspec, > unsigned long *hwirq, > @@ -1053,8 +1044,16 @@ static int pmic_gpio_probe(struct platform_device *pdev) > if (!parent_domain) > return -ENXIO; > > + state->irq.name = "spmi-gpio", > + state->irq.irq_ack = irq_chip_ack_parent, > + state->irq.irq_mask = irq_chip_mask_parent, > + state->irq.irq_unmask = irq_chip_unmask_parent, > + state->irq.irq_set_type = irq_chip_set_type_parent, > + state->irq.irq_set_wake = irq_chip_set_wake_parent, > + state->irq.flags = IRQCHIP_MASK_ON_SUSPEND, > + > girq = &state->chip.irq; > - girq->chip = &pmic_gpio_irq_chip; > + girq->chip = &state->irq; > girq->default_type = IRQ_TYPE_NONE; > girq->handler = handle_level_irq; > girq->fwnode = of_node_to_fwnode(state->dev->of_node); > -- > 2.26.2 >