.. | .. |
---|
122 | 122 | static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) |
---|
123 | 123 | { |
---|
124 | 124 | struct gpio_chip *chip = &cc->gpio; |
---|
| 125 | + struct gpio_irq_chip *girq = &chip->irq; |
---|
125 | 126 | int hwirq, err; |
---|
126 | 127 | |
---|
127 | 128 | if (cc->core->bus->hosttype != BCMA_HOSTTYPE_SOC) |
---|
.. | .. |
---|
136 | 137 | bcma_chipco_gpio_intmask(cc, ~0, 0); |
---|
137 | 138 | bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO); |
---|
138 | 139 | |
---|
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; |
---|
148 | 147 | |
---|
149 | 148 | return 0; |
---|
150 | 149 | } |
---|
.. | .. |
---|
183 | 182 | chip->direction_input = bcma_gpio_direction_input; |
---|
184 | 183 | chip->direction_output = bcma_gpio_direction_output; |
---|
185 | 184 | chip->owner = THIS_MODULE; |
---|
186 | | - chip->parent = bcma_bus_get_host_dev(bus); |
---|
| 185 | + chip->parent = bus->dev; |
---|
187 | 186 | #if IS_BUILTIN(CONFIG_OF) |
---|
188 | 187 | chip->of_node = cc->core->dev.of_node; |
---|
189 | 188 | #endif |
---|
.. | .. |
---|
212 | 211 | else |
---|
213 | 212 | chip->base = -1; |
---|
214 | 213 | |
---|
215 | | - err = gpiochip_add_data(chip, cc); |
---|
| 214 | + err = bcma_gpio_irq_init(cc); |
---|
216 | 215 | if (err) |
---|
217 | 216 | return err; |
---|
218 | 217 | |
---|
219 | | - err = bcma_gpio_irq_init(cc); |
---|
| 218 | + err = gpiochip_add_data(chip, cc); |
---|
220 | 219 | if (err) { |
---|
221 | | - gpiochip_remove(chip); |
---|
| 220 | + bcma_gpio_irq_exit(cc); |
---|
222 | 221 | return err; |
---|
223 | 222 | } |
---|
224 | 223 | |
---|