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

Configure Feed

Select the types of activity you want to include in your feed.

irqchip/renesas-rzg2l: Simplify rzg2l_irqc_irq_{en,dis}able()

Simplify rzg2l_irqc_irq_{en,dis}able() by moving common code to
rzg2l_tint_irq_endisable().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Biju Das and committed by
Thomas Gleixner
46efb305 4cece764

+11 -17
+11 -17
drivers/irqchip/irq-renesas-rzg2l.c
··· 138 138 irq_chip_eoi_parent(d); 139 139 } 140 140 141 - static void rzg2l_irqc_irq_disable(struct irq_data *d) 141 + static void rzg2l_tint_irq_endisable(struct irq_data *d, bool enable) 142 142 { 143 143 unsigned int hw_irq = irqd_to_hwirq(d); 144 144 ··· 151 151 152 152 raw_spin_lock(&priv->lock); 153 153 reg = readl_relaxed(priv->base + TSSR(tssr_index)); 154 - reg &= ~(TIEN << TSSEL_SHIFT(tssr_offset)); 154 + if (enable) 155 + reg |= TIEN << TSSEL_SHIFT(tssr_offset); 156 + else 157 + reg &= ~(TIEN << TSSEL_SHIFT(tssr_offset)); 155 158 writel_relaxed(reg, priv->base + TSSR(tssr_index)); 156 159 raw_spin_unlock(&priv->lock); 157 160 } 161 + } 162 + 163 + static void rzg2l_irqc_irq_disable(struct irq_data *d) 164 + { 165 + rzg2l_tint_irq_endisable(d, false); 158 166 irq_chip_disable_parent(d); 159 167 } 160 168 161 169 static void rzg2l_irqc_irq_enable(struct irq_data *d) 162 170 { 163 - unsigned int hw_irq = irqd_to_hwirq(d); 164 - 165 - if (hw_irq >= IRQC_TINT_START && hw_irq < IRQC_NUM_IRQ) { 166 - struct rzg2l_irqc_priv *priv = irq_data_to_priv(d); 167 - u32 offset = hw_irq - IRQC_TINT_START; 168 - u32 tssr_offset = TSSR_OFFSET(offset); 169 - u8 tssr_index = TSSR_INDEX(offset); 170 - u32 reg; 171 - 172 - raw_spin_lock(&priv->lock); 173 - reg = readl_relaxed(priv->base + TSSR(tssr_index)); 174 - reg |= TIEN << TSSEL_SHIFT(tssr_offset); 175 - writel_relaxed(reg, priv->base + TSSR(tssr_index)); 176 - raw_spin_unlock(&priv->lock); 177 - } 171 + rzg2l_tint_irq_endisable(d, true); 178 172 irq_chip_enable_parent(d); 179 173 } 180 174