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: Drop checking port type for device file{create, remove}

Ports that support FIFO has fifosize > 1. Replace checking the port type
with fifosize for device file{create, remove}.

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-5-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
42f7303c b346e5d7

+4 -11
+4 -11
drivers/tty/serial/sh-sci.c
··· 3549 3549 static void sci_remove(struct platform_device *dev) 3550 3550 { 3551 3551 struct sci_port *s = platform_get_drvdata(dev); 3552 - unsigned int type = s->type; /* uart_remove_... clears it */ 3553 3552 3554 3553 sci_ports_in_use &= ~BIT(s->port.line); 3555 3554 uart_remove_one_port(&sci_uart_driver, &s->port); 3556 3555 3557 - if (s->port.fifosize > 1) 3556 + if (s->port.fifosize > 1) { 3558 3557 device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger); 3559 - if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF || 3560 - type == SCI_PORT_RSCI) 3561 3558 device_remove_file(&dev->dev, &dev_attr_rx_fifo_timeout); 3559 + } 3562 3560 } 3563 3561 3564 3562 static const struct sci_of_data of_sci_scif_sh2 = { ··· 3915 3917 ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_trigger); 3916 3918 if (ret) 3917 3919 return ret; 3918 - } 3919 - if (sp->type == PORT_SCIFA || sp->type == PORT_SCIFB || 3920 - sp->type == PORT_HSCIF || sp->type == SCI_PORT_RSCI) { 3920 + 3921 3921 ret = device_create_file(&dev->dev, &dev_attr_rx_fifo_timeout); 3922 3922 if (ret) { 3923 - if (sp->port.fifosize > 1) { 3924 - device_remove_file(&dev->dev, 3925 - &dev_attr_rx_fifo_trigger); 3926 - } 3923 + device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger); 3927 3924 return ret; 3928 3925 } 3929 3926 }