[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251125150632.299890-3-biju.das.jz@bp.renesas.com>
Date: Tue, 25 Nov 2025 15:06:04 +0000
From: Biju <biju.das.au@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>
Cc: Biju Das <biju.das.jz@...renesas.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org,
devicetree@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
Biju Das <biju.das.au@...il.com>
Subject: [PATCH v4 02/16] serial: sh-sci: Add sci_is_fifo_type()
From: Biju Das <biju.das.jz@...renesas.com>
Add sci_is_fifo_type() helper for SCI operates in FIFO mode to
simplify the code in probe() and remove().
Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
---
v4:
* New patch.
---
drivers/tty/serial/sh-sci.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 53edbf1d8963..56d6489b2a7c 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -3546,6 +3546,12 @@ static struct uart_driver sci_uart_driver = {
.cons = SCI_CONSOLE,
};
+static bool sci_is_fifo_type(u8 type)
+{
+ return (type == PORT_SCIFA || type == PORT_SCIFB ||
+ type == PORT_HSCIF || type == SCI_PORT_RSCI);
+}
+
static void sci_remove(struct platform_device *dev)
{
struct sci_port *s = platform_get_drvdata(dev);
@@ -3556,8 +3562,7 @@ static void sci_remove(struct platform_device *dev)
if (s->port.fifosize > 1)
device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger);
- if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF ||
- type == SCI_PORT_RSCI)
+ if (sci_is_fifo_type(type))
device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout);
}
@@ -3918,8 +3923,7 @@ static int sci_probe(struct platform_device *dev)
if (ret)
return ret;
}
- if (sp->type == PORT_SCIFA || sp->type == PORT_SCIFB ||
- sp->type == PORT_HSCIF || sp->type == SCI_PORT_RSCI) {
+ if (sci_is_fifo_type(sp->type)) {
ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout);
if (ret) {
if (sp->port.fifosize > 1) {
--
2.43.0
Powered by blists - more mailing lists