diff mbox series

[v2] serial: mps2-uart: Check for error irq

Message ID 20211223114038.1306663-1-jiasheng@iscas.ac.cn
State New
Headers show
Series [v2] serial: mps2-uart: Check for error irq | expand

Commit Message

Jiasheng Jiang Dec. 23, 2021, 11:40 a.m. UTC
On Thursday, December 23, 2021, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> Check the types.

That's right.
I correct previous version, using error variable to check.

Fixes: 041f031def33 ("serial: mps2-uart: add MPS2 UART driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
Changelog:

v1 -> v2

*Change 1.USing error variable to check.
---
 drivers/tty/serial/mps2-uart.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

Comments

Andy Shevchenko Dec. 23, 2021, 12:01 p.m. UTC | #1
On Thu, Dec 23, 2021 at 1:40 PM Jiasheng Jiang <jiasheng@iscas.ac.cn> wrote:
>
> On Thursday, December 23, 2021, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > Check the types.
>
> That's right.
> I correct previous version, using error variable to check.

Below (tags and code) everything is fine, now you need to prepare the
correct commit message and send a v3.
diff mbox series

Patch

diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c
index 587b42f754cb..24a52300d8d9 100644
--- a/drivers/tty/serial/mps2-uart.c
+++ b/drivers/tty/serial/mps2-uart.c
@@ -584,11 +584,29 @@  static int mps2_init_port(struct platform_device *pdev,
 
 
 	if (mps_port->flags & UART_PORT_COMBINED_IRQ) {
-		mps_port->port.irq = platform_get_irq(pdev, 0);
+		ret = platform_get_irq(pdev, 0);
+		if (ret < 0)
+			return ret;
+
+		mps_port->port.irq = ret;
 	} else {
-		mps_port->rx_irq = platform_get_irq(pdev, 0);
-		mps_port->tx_irq = platform_get_irq(pdev, 1);
-		mps_port->port.irq = platform_get_irq(pdev, 2);
+		ret = platform_get_irq(pdev, 0);
+		if (ret < 0)
+			return ret;
+
+		mps_port->rx_irq = ret;
+
+		ret = platform_get_irq(pdev, 1);
+		if (ret < 0)
+			return ret;
+
+		mps_port->tx_irq = ret;
+
+		ret = platform_get_irq(pdev, 2);
+		if (ret < 0)
+			return ret;
+
+		mps_port->port.irq = ret;
 	}
 
 	return ret;