Skip to content

Commit 641a41d

Browse files
shimodaygregkh
authored andcommitted
serial: sh-sci: Fix could not remove dev_attr_rx_fifo_timeout
This patch fixes an issue that the sci_remove() could not remove dev_attr_rx_fifo_timeout because uart_remove_one_port() set the port->port.type to PORT_UNKNOWN. Reported-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com> Fixes: 5d23188 ("serial: sh-sci: make RX FIFO parameters tunable via sysfs") Cc: <stable@vger.kernel.org> # v4.11+ Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d0ffb80 commit 641a41d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/sh-sci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,7 @@ static struct uart_driver sci_uart_driver = {
31023102
static int sci_remove(struct platform_device *dev)
31033103
{
31043104
struct sci_port *port = platform_get_drvdata(dev);
3105+
unsigned int type = port->port.type; /* uart_remove_... clears it */
31053106

31063107
sci_ports_in_use &= ~BIT(port->port.line);
31073108
uart_remove_one_port(&sci_uart_driver, &port->port);
@@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_device *dev)
31123113
sysfs_remove_file(&dev->dev.kobj,
31133114
&dev_attr_rx_fifo_trigger.attr);
31143115
}
3115-
if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB ||
3116-
port->port.type == PORT_HSCIF) {
3116+
if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) {
31173117
sysfs_remove_file(&dev->dev.kobj,
31183118
&dev_attr_rx_fifo_timeout.attr);
31193119
}

0 commit comments

Comments
 (0)