Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1706592

[PATCH 1/3] serial: 8250_uniphier: fix serial port index in private data

From Masahiro Yamada <yamada.masahiro@socionext.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] serial: 8250_uniphier: fix serial port index in private data
Date 2017-08-08 16:00 +0200
Message-ID <ucdd9-Hf-33@gated-at.bofh.it> (permalink)
References <ucdd8-Hf-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


serial8250_register_8250_port() may allocate a different port index
than requested.  The driver needs to remember the returned value of
serial8250_register_8250_port() for later use.  Otherwise, the .remove
hook may unregister a different port.

Fixes: 1a8d2903cb6a ("serial: 8250_uniphier: add UniPhier serial driver")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/tty/serial/8250/8250_uniphier.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c
index 746680ebf90c..633ac378b7f2 100644
--- a/drivers/tty/serial/8250/8250_uniphier.c
+++ b/drivers/tty/serial/8250/8250_uniphier.c
@@ -169,7 +169,7 @@ static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port,
 		dev_err(dev, "failed to get alias id\n");
 		return ret;
 	}
-	port->line = priv->line = ret;
+	port->line = ret;
 
 	/* Get clk rate through clk driver */
 	priv->clk = devm_clk_get(dev, NULL);
@@ -249,8 +249,8 @@ static int uniphier_uart_probe(struct platform_device *pdev)
 	up.dl_read = uniphier_serial_dl_read;
 	up.dl_write = uniphier_serial_dl_write;
 
-	ret = serial8250_register_8250_port(&up);
-	if (ret < 0) {
+	priv->line = serial8250_register_8250_port(&up);
+	if (priv->line < 0) {
 		dev_err(dev, "failed to register 8250 port\n");
 		clk_disable_unprepare(priv->clk);
 		return ret;
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] serial: 8250_uniphier: bug fix and suspend/resume support Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-08-08 16:00 +0200
  [PATCH 1/3] serial: 8250_uniphier: fix serial port index in private data Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-08-08 16:00 +0200
  [PATCH 2/3] serial: 8250_uniphier: use CHAR register for canary to detect power-off Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-08-08 16:00 +0200

csiph-web