mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	genirq/manage: Rework enable_irq()
Use the new guards to get and lock the interrupt descriptor and tidy up the code. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20250429065422.071157729@linutronix.de
This commit is contained in:
		
							parent
							
								
									1b74444467
								
							
						
					
					
						commit
						bddd10c554
					
				
					 1 changed files with 6 additions and 11 deletions
				
			
		|  | @ -789,18 +789,13 @@ void __enable_irq(struct irq_desc *desc) | ||||||
|  */ |  */ | ||||||
| void enable_irq(unsigned int irq) | void enable_irq(unsigned int irq) | ||||||
| { | { | ||||||
| 	unsigned long flags; | 	scoped_irqdesc_get_and_lock(irq, IRQ_GET_DESC_CHECK_GLOBAL) { | ||||||
| 	struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL); | 		struct irq_desc *desc = scoped_irqdesc; | ||||||
| 
 | 
 | ||||||
| 	if (!desc) | 		if (WARN(!desc->irq_data.chip, "enable_irq before setup/request_irq: irq %u\n", irq)) | ||||||
| 		return; | 			return; | ||||||
| 	if (WARN(!desc->irq_data.chip, | 		__enable_irq(desc); | ||||||
| 		 KERN_ERR "enable_irq before setup/request_irq: irq %u\n", irq)) | 	} | ||||||
| 		goto out; |  | ||||||
| 
 |  | ||||||
| 	__enable_irq(desc); |  | ||||||
| out: |  | ||||||
| 	irq_put_desc_busunlock(desc, flags); |  | ||||||
| } | } | ||||||
| EXPORT_SYMBOL(enable_irq); | EXPORT_SYMBOL(enable_irq); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Thomas Gleixner
						Thomas Gleixner