File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -700,7 +700,7 @@ extern void note_interrupt(struct irq_desc *desc, irqreturn_t action_ret);
700
700
extern int noirqdebug_setup (char * str );
701
701
702
702
/* Checks whether the interrupt can be requested by request_irq(): */
703
- extern int can_request_irq (unsigned int irq , unsigned long irqflags );
703
+ extern bool can_request_irq (unsigned int irq , unsigned long irqflags );
704
704
705
705
/* Dummy irq-chip implementations: */
706
706
extern struct irq_chip no_irq_chip ;
Original file line number Diff line number Diff line change @@ -888,22 +888,17 @@ EXPORT_SYMBOL(irq_set_irq_wake);
888
888
* particular irq has been exclusively allocated or is available
889
889
* for driver use.
890
890
*/
891
- int can_request_irq (unsigned int irq , unsigned long irqflags )
891
+ bool can_request_irq (unsigned int irq , unsigned long irqflags )
892
892
{
893
- unsigned long flags ;
894
- struct irq_desc * desc = irq_get_desc_lock (irq , & flags , 0 );
895
- int canrequest = 0 ;
896
-
897
- if (!desc )
898
- return 0 ;
893
+ scoped_irqdesc_get_and_lock (irq , IRQ_GET_DESC_CHECK_GLOBAL ) {
894
+ struct irq_desc * desc = scoped_irqdesc ;
899
895
900
- if (irq_settings_can_request (desc )) {
901
- if (!desc -> action ||
902
- irqflags & desc -> action -> flags & IRQF_SHARED )
903
- canrequest = 1 ;
896
+ if (irq_settings_can_request (desc )) {
897
+ if (!desc -> action || irqflags & desc -> action -> flags & IRQF_SHARED )
898
+ return true;
899
+ }
904
900
}
905
- irq_put_desc_unlock (desc , flags );
906
- return canrequest ;
901
+ return false;
907
902
}
908
903
909
904
int __irq_set_trigger (struct irq_desc * desc , unsigned long flags )
You can’t perform that action at this time.
0 commit comments