Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

irqchip/irq-brcmstb-l2: Replace brcmstb_l2_mask_and_ack() by generic function

Replace brcmstb_l2_mask_and_ack() by the generic
irq_gc_mask_disable_and_ack_set().

brcmstb_l2_mask_and_ack() was added in commit 49aa6ef0b439
("irqchip/brcmstb-l2: Remove some processing from the handler") in
September 2017 with a comment saying it was actually generic and someone
should add it to the generic code.

commit 20608924cc2e ("genirq: generic chip: Add
irq_gc_mask_disable_and_ack_set()") did that a few weeks later, however no
one went back and took the brcmstb variant out.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/all/20241224001727.149337-1-linux@treblig.org

authored by

Dr. David Alan Gilbert and committed by
Thomas Gleixner
dd1f17a9 877c76db

+1 -27
+1 -27
drivers/irqchip/irq-brcmstb-l2.c
··· 61 61 u32 saved_mask; /* for suspend/resume */ 62 62 }; 63 63 64 - /** 65 - * brcmstb_l2_mask_and_ack - Mask and ack pending interrupt 66 - * @d: irq_data 67 - * 68 - * Chip has separate enable/disable registers instead of a single mask 69 - * register and pending interrupt is acknowledged by setting a bit. 70 - * 71 - * Note: This function is generic and could easily be added to the 72 - * generic irqchip implementation if there ever becomes a will to do so. 73 - * Perhaps with a name like irq_gc_mask_disable_and_ack_set(). 74 - * 75 - * e.g.: https://patchwork.kernel.org/patch/9831047/ 76 - */ 77 - static void brcmstb_l2_mask_and_ack(struct irq_data *d) 78 - { 79 - struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 80 - struct irq_chip_type *ct = irq_data_get_chip_type(d); 81 - u32 mask = d->mask; 82 - 83 - irq_gc_lock(gc); 84 - irq_reg_writel(gc, mask, ct->regs.disable); 85 - *ct->mask_cache &= ~mask; 86 - irq_reg_writel(gc, mask, ct->regs.ack); 87 - irq_gc_unlock(gc); 88 - } 89 - 90 64 static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc) 91 65 { 92 66 struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc); ··· 222 248 if (init_params->cpu_clear >= 0) { 223 249 ct->regs.ack = init_params->cpu_clear; 224 250 ct->chip.irq_ack = irq_gc_ack_set_bit; 225 - ct->chip.irq_mask_ack = brcmstb_l2_mask_and_ack; 251 + ct->chip.irq_mask_ack = irq_gc_mask_disable_and_ack_set; 226 252 } else { 227 253 /* No Ack - but still slightly more efficient to define this */ 228 254 ct->chip.irq_mask_ack = irq_gc_mask_disable_reg;