@@ -2286,35 +2286,25 @@ int request_nmi(unsigned int irq, irq_handler_t handler,
2286
2286
2287
2287
void enable_percpu_irq (unsigned int irq , unsigned int type )
2288
2288
{
2289
- unsigned int cpu = smp_processor_id ();
2290
- unsigned long flags ;
2291
- struct irq_desc * desc = irq_get_desc_lock (irq , & flags , IRQ_GET_DESC_CHECK_PERCPU );
2292
-
2293
- if (!desc )
2294
- return ;
2295
-
2296
- /*
2297
- * If the trigger type is not specified by the caller, then
2298
- * use the default for this interrupt.
2299
- */
2300
- type &= IRQ_TYPE_SENSE_MASK ;
2301
- if (type == IRQ_TYPE_NONE )
2302
- type = irqd_get_trigger_type (& desc -> irq_data );
2303
-
2304
- if (type != IRQ_TYPE_NONE ) {
2305
- int ret ;
2306
-
2307
- ret = __irq_set_trigger (desc , type );
2289
+ scoped_irqdesc_get_and_lock (irq , IRQ_GET_DESC_CHECK_PERCPU ) {
2290
+ struct irq_desc * desc = scoped_irqdesc ;
2308
2291
2309
- if (ret ) {
2310
- WARN (1 , "failed to set type for IRQ%d\n" , irq );
2311
- goto out ;
2292
+ /*
2293
+ * If the trigger type is not specified by the caller, then
2294
+ * use the default for this interrupt.
2295
+ */
2296
+ type &= IRQ_TYPE_SENSE_MASK ;
2297
+ if (type == IRQ_TYPE_NONE )
2298
+ type = irqd_get_trigger_type (& desc -> irq_data );
2299
+
2300
+ if (type != IRQ_TYPE_NONE ) {
2301
+ if (__irq_set_trigger (desc , type )) {
2302
+ WARN (1 , "failed to set type for IRQ%d\n" , irq );
2303
+ return ;
2304
+ }
2312
2305
}
2306
+ irq_percpu_enable (desc , smp_processor_id ());
2313
2307
}
2314
-
2315
- irq_percpu_enable (desc , cpu );
2316
- out :
2317
- irq_put_desc_unlock (desc , flags );
2318
2308
}
2319
2309
EXPORT_SYMBOL_GPL (enable_percpu_irq );
2320
2310
0 commit comments