File tree Expand file tree Collapse file tree 1 file changed +15
-28
lines changed Expand file tree Collapse file tree 1 file changed +15
-28
lines changed Original file line number Diff line number Diff line change @@ -2703,39 +2703,26 @@ EXPORT_SYMBOL_GPL(irq_get_irqchip_state);
2703
2703
*/
2704
2704
int irq_set_irqchip_state (unsigned int irq , enum irqchip_irq_state which , bool val )
2705
2705
{
2706
- struct irq_desc * desc ;
2707
- struct irq_data * data ;
2708
- struct irq_chip * chip ;
2709
- unsigned long flags ;
2710
- int err = - EINVAL ;
2706
+ scoped_irqdesc_get_and_buslock (irq , 0 ) {
2707
+ struct irq_data * data = irq_desc_get_irq_data (scoped_irqdesc );
2708
+ struct irq_chip * chip ;
2711
2709
2712
- desc = irq_get_desc_buslock (irq , & flags , 0 );
2713
- if (!desc )
2714
- return err ;
2710
+ do {
2711
+ chip = irq_data_get_irq_chip (data );
2715
2712
2716
- data = irq_desc_get_irq_data (desc );
2713
+ if (WARN_ON_ONCE (!chip ))
2714
+ return - ENODEV ;
2717
2715
2718
- do {
2719
- chip = irq_data_get_irq_chip (data );
2720
- if (WARN_ON_ONCE (!chip )) {
2721
- err = - ENODEV ;
2722
- goto out_unlock ;
2723
- }
2724
- if (chip -> irq_set_irqchip_state )
2725
- break ;
2726
- #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
2727
- data = data -> parent_data ;
2728
- #else
2729
- data = NULL ;
2730
- #endif
2731
- } while (data );
2716
+ if (chip -> irq_set_irqchip_state )
2717
+ break ;
2732
2718
2733
- if (data )
2734
- err = chip -> irq_set_irqchip_state (data , which , val );
2719
+ data = irqd_get_parent_data (data );
2720
+ } while (data );
2735
2721
2736
- out_unlock :
2737
- irq_put_desc_busunlock (desc , flags );
2738
- return err ;
2722
+ if (data )
2723
+ return chip -> irq_set_irqchip_state (data , which , val );
2724
+ }
2725
+ return - EINVAL ;
2739
2726
}
2740
2727
EXPORT_SYMBOL_GPL (irq_set_irqchip_state );
2741
2728
You can’t perform that action at this time.
0 commit comments