@@ -440,6 +440,7 @@ static int dln2_gpio_probe(struct platform_device *pdev)
440
440
{
441
441
struct dln2_gpio * dln2 ;
442
442
struct device * dev = & pdev -> dev ;
443
+ struct gpio_irq_chip * girq ;
443
444
int pins ;
444
445
int ret ;
445
446
@@ -476,6 +477,15 @@ static int dln2_gpio_probe(struct platform_device *pdev)
476
477
dln2 -> gpio .direction_output = dln2_gpio_direction_output ;
477
478
dln2 -> gpio .set_config = dln2_gpio_set_config ;
478
479
480
+ girq = & dln2 -> gpio .irq ;
481
+ girq -> chip = & dln2_gpio_irqchip ;
482
+ /* The event comes from the outside so no parent handler */
483
+ girq -> parent_handler = NULL ;
484
+ girq -> num_parents = 0 ;
485
+ girq -> parents = NULL ;
486
+ girq -> default_type = IRQ_TYPE_NONE ;
487
+ girq -> handler = handle_simple_irq ;
488
+
479
489
platform_set_drvdata (pdev , dln2 );
480
490
481
491
ret = devm_gpiochip_add_data (dev , & dln2 -> gpio , dln2 );
@@ -484,13 +494,6 @@ static int dln2_gpio_probe(struct platform_device *pdev)
484
494
return ret ;
485
495
}
486
496
487
- ret = gpiochip_irqchip_add (& dln2 -> gpio , & dln2_gpio_irqchip , 0 ,
488
- handle_simple_irq , IRQ_TYPE_NONE );
489
- if (ret < 0 ) {
490
- dev_err (dev , "failed to add irq chip: %d\n" , ret );
491
- return ret ;
492
- }
493
-
494
497
ret = dln2_register_event_cb (pdev , DLN2_GPIO_CONDITION_MET_EV ,
495
498
dln2_gpio_event );
496
499
if (ret ) {
0 commit comments