Commit 641a41db authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Greg Kroah-Hartman

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: default avatarHiromitsu Yamasaki <hiromitsu.yamasaki.ym@renesas.com>
Fixes: 5d23188a ("serial: sh-sci: make RX FIFO parameters tunable via sysfs")
Cc: <stable@vger.kernel.org> # v4.11+
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: default avatarUlrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0ffb805
...@@ -3102,6 +3102,7 @@ static struct uart_driver sci_uart_driver = { ...@@ -3102,6 +3102,7 @@ static struct uart_driver sci_uart_driver = {
static int sci_remove(struct platform_device *dev) static int sci_remove(struct platform_device *dev)
{ {
struct sci_port *port = platform_get_drvdata(dev); struct sci_port *port = platform_get_drvdata(dev);
unsigned int type = port->port.type; /* uart_remove_... clears it */
sci_ports_in_use &= ~BIT(port->port.line); sci_ports_in_use &= ~BIT(port->port.line);
uart_remove_one_port(&sci_uart_driver, &port->port); uart_remove_one_port(&sci_uart_driver, &port->port);
...@@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_device *dev) ...@@ -3112,8 +3113,7 @@ static int sci_remove(struct platform_device *dev)
sysfs_remove_file(&dev->dev.kobj, sysfs_remove_file(&dev->dev.kobj,
&dev_attr_rx_fifo_trigger.attr); &dev_attr_rx_fifo_trigger.attr);
} }
if (port->port.type == PORT_SCIFA || port->port.type == PORT_SCIFB || if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) {
port->port.type == PORT_HSCIF) {
sysfs_remove_file(&dev->dev.kobj, sysfs_remove_file(&dev->dev.kobj,
&dev_attr_rx_fifo_timeout.attr); &dev_attr_rx_fifo_timeout.attr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment