Skip to content

Commit b3801dd

Browse files
committed
genirq/chip: Rework irq_set_chip_data()
Use the new guards to get and lock the interrupt descriptor and tidy up the code. Fixup the kernel doc comment while at it. No functional change. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent c836e5a commit b3801dd

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

kernel/irq/chip.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,19 @@ int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry)
115115
}
116116

117117
/**
118-
* irq_set_chip_data - set irq chip data for an irq
119-
* @irq: Interrupt number
120-
* @data: Pointer to chip specific data
118+
* irq_set_chip_data - set irq chip data for an irq
119+
* @irq: Interrupt number
120+
* @data: Pointer to chip specific data
121121
*
122-
* Set the hardware irq chip data for an irq
122+
* Set the hardware irq chip data for an irq
123123
*/
124124
int irq_set_chip_data(unsigned int irq, void *data)
125125
{
126-
unsigned long flags;
127-
struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
128-
129-
if (!desc)
130-
return -EINVAL;
131-
desc->irq_data.chip_data = data;
132-
irq_put_desc_unlock(desc, flags);
133-
return 0;
126+
scoped_irqdesc_get_and_lock(irq, 0) {
127+
scoped_irqdesc->irq_data.chip_data = data;
128+
return 0;
129+
}
130+
return -EINVAL;
134131
}
135132
EXPORT_SYMBOL(irq_set_chip_data);
136133

0 commit comments

Comments
 (0)