[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUVt6usA9DvzpzKz7OHYppuFH=jWGKRMqEPDzeoUyTXSw@mail.gmail.com>
Date: Wed, 26 Nov 2025 09:00:09 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Biju <biju.das.au@...il.com>
Cc: 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>,
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
Subject: Re: [PATCH v4 02/16] serial: sh-sci: Add sci_is_fifo_type()
Hi Biju,
On Tue, 25 Nov 2025 at 16:06, Biju <biju.das.au@...il.com> wrote:
> 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>
Thanks for your patch!
> --- 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)
sci_has_fifo?
> +{
> + 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);
I am wondering if we could just check for s->port.fifosize > 1 instead,
and thus combine with the above check? We do have to fill in .set_rtg =
rsci_scif_set_rtrg first, but are there other hurdles to take?
> }
>
> @@ -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)) {
Likewise.
> ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout);
> if (ret) {
> if (sp->port.fifosize > 1) {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists