@@ -834,6 +834,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
834
834
struct irq_chip * irq_chip = & chip -> irq_chip ;
835
835
DECLARE_BITMAP (reg_direction , MAX_LINE );
836
836
DECLARE_BITMAP (irq_stat , MAX_LINE );
837
+ struct gpio_irq_chip * girq ;
837
838
int ret ;
838
839
839
840
if (dmi_first_match (pca953x_dmi_acpi_irq_info )) {
@@ -883,16 +884,16 @@ static int pca953x_irq_setup(struct pca953x_chip *chip, int irq_base)
883
884
irq_chip -> irq_set_type = pca953x_irq_set_type ;
884
885
irq_chip -> irq_shutdown = pca953x_irq_shutdown ;
885
886
886
- ret = gpiochip_irqchip_add_nested ( & chip -> gpio_chip , irq_chip ,
887
- irq_base , handle_simple_irq ,
888
- IRQ_TYPE_NONE );
889
- if ( ret ) {
890
- dev_err ( & client -> dev ,
891
- "could not connect irqchip to gpiochip\n" ) ;
892
- return ret ;
893
- }
894
-
895
- gpiochip_set_nested_irqchip ( & chip -> gpio_chip , irq_chip , client -> irq );
887
+ girq = & chip -> gpio_chip . irq ;
888
+ girq -> chip = irq_chip ;
889
+ /* This will let us handle the parent IRQ in the driver */
890
+ girq -> parent_handler = NULL ;
891
+ girq -> num_parents = 0 ;
892
+ girq -> parents = NULL ;
893
+ girq -> default_type = IRQ_TYPE_NONE ;
894
+ girq -> handler = handle_simple_irq ;
895
+ girq -> threaded = true;
896
+ girq -> first = irq_base ; /* FIXME: get rid of this */
896
897
897
898
return 0 ;
898
899
}
@@ -1080,11 +1081,11 @@ static int pca953x_probe(struct i2c_client *client,
1080
1081
if (ret )
1081
1082
goto err_exit ;
1082
1083
1083
- ret = devm_gpiochip_add_data ( & client -> dev , & chip -> gpio_chip , chip );
1084
+ ret = pca953x_irq_setup ( chip , irq_base );
1084
1085
if (ret )
1085
1086
goto err_exit ;
1086
1087
1087
- ret = pca953x_irq_setup ( chip , irq_base );
1088
+ ret = devm_gpiochip_add_data ( & client -> dev , & chip -> gpio_chip , chip );
1088
1089
if (ret )
1089
1090
goto err_exit ;
1090
1091
0 commit comments