hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/bcma/driver_gpio.c
....@@ -122,6 +122,7 @@
122122 static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
123123 {
124124 struct gpio_chip *chip = &cc->gpio;
125
+ struct gpio_irq_chip *girq = &chip->irq;
125126 int hwirq, err;
126127
127128 if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC)
....@@ -136,15 +137,13 @@
136137 bcma_chipco_gpio_intmask(cc, ~0, 0);
137138 bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO);
138139
139
- err = gpiochip_irqchip_add(chip,
140
- &bcma_gpio_irq_chip,
141
- 0,
142
- handle_simple_irq,
143
- IRQ_TYPE_NONE);
144
- if (err) {
145
- free_irq(hwirq, cc);
146
- return err;
147
- }
140
+ girq->chip = &bcma_gpio_irq_chip;
141
+ /* This will let us handle the parent IRQ in the driver */
142
+ girq->parent_handler = NULL;
143
+ girq->num_parents = 0;
144
+ girq->parents = NULL;
145
+ girq->default_type = IRQ_TYPE_NONE;
146
+ girq->handler = handle_simple_irq;
148147
149148 return 0;
150149 }
....@@ -183,7 +182,7 @@
183182 chip->direction_input = bcma_gpio_direction_input;
184183 chip->direction_output = bcma_gpio_direction_output;
185184 chip->owner = THIS_MODULE;
186
- chip->parent = bcma_bus_get_host_dev(bus);
185
+ chip->parent = bus->dev;
187186 #if IS_BUILTIN(CONFIG_OF)
188187 chip->of_node = cc->core->dev.of_node;
189188 #endif
....@@ -212,13 +211,13 @@
212211 else
213212 chip->base = -1;
214213
215
- err = gpiochip_add_data(chip, cc);
214
+ err = bcma_gpio_irq_init(cc);
216215 if (err)
217216 return err;
218217
219
- err = bcma_gpio_irq_init(cc);
218
+ err = gpiochip_add_data(chip, cc);
220219 if (err) {
221
- gpiochip_remove(chip);
220
+ bcma_gpio_irq_exit(cc);
222221 return err;
223222 }
224223