@@ -122,6 +122,7 @@ static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id)
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,15 +137,13 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc)
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
}
@@ -212,13 +211,13 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)
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
0 commit comments