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.

serial: sh-sci: Add sci_is_rsci_type()

Add sci_is_rsci_type() for RSCI port type. This will simplify the code
when the support added for RSCI_PORT_SCIF32 private PORT type.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20251129164325.209213-11-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Biju Das and committed by
Greg Kroah-Hartman
7d8b226b 850ec928

+9 -4
+9 -4
drivers/tty/serial/sh-sci.c
··· 1182 1182 return copied; 1183 1183 } 1184 1184 1185 + static bool sci_is_rsci_type(u8 type) 1186 + { 1187 + return (type == SCI_PORT_RSCI); 1188 + } 1189 + 1185 1190 static int sci_handle_fifo_overrun(struct uart_port *port) 1186 1191 { 1187 1192 struct tty_port *tport = &port->state->port; ··· 1195 1190 int copied = 0; 1196 1191 u32 status; 1197 1192 1198 - if (s->type != SCI_PORT_RSCI) { 1193 + if (!sci_is_rsci_type(s->type)) { 1199 1194 reg = sci_getreg(port, s->params->overrun_reg); 1200 1195 if (!reg->size) 1201 1196 return 0; ··· 1203 1198 1204 1199 status = s->ops->read_reg(port, s->params->overrun_reg); 1205 1200 if (status & s->params->overrun_mask) { 1206 - if (s->type == SCI_PORT_RSCI) { 1201 + if (sci_is_rsci_type(s->type)) { 1207 1202 /* 1208 1203 * All of the CFCLR_*C clearing bits match the corresponding 1209 1204 * CSR_*status bits. So, reuse the overrun mask for clearing. ··· 2020 2015 unsigned long flags; 2021 2016 u32 ctrl; 2022 2017 2023 - if (s->type != PORT_SCI && s->type != SCI_PORT_RSCI) 2018 + if (s->type != PORT_SCI && !sci_is_rsci_type(s->type)) 2024 2019 return sci_tx_interrupt(irq, ptr); 2025 2020 2026 2021 uart_port_lock_irqsave(port, &flags); ··· 3294 3289 * The fourth interrupt on SCI and RSCI port is transmit end interrupt, so 3295 3290 * shuffle the interrupts. 3296 3291 */ 3297 - if (p->type == PORT_SCI || p->type == SCI_PORT_RSCI) 3292 + if (p->type == PORT_SCI || sci_is_rsci_type(p->type)) 3298 3293 swap(sci_port->irqs[SCIx_BRI_IRQ], sci_port->irqs[SCIx_TEI_IRQ]); 3299 3294 3300 3295 /* The SCI generates several interrupts. They can be muxed together or