Skip to content

Commit

Permalink
Merge pull request torvalds#624 from MrCry0/5.15-2.2.x-imx-fix-lpuart
Browse files Browse the repository at this point in the history
5.15 2.2.x-imx: refix lpuart
  • Loading branch information
otavio authored Feb 8, 2023
2 parents 3248ffc + 645fce6 commit 0eb4504
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/tty/serial/fsl_lpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,10 @@ static int lpuart_probe(struct platform_device *pdev)
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);

ret = uart_add_one_port(&lpuart_reg, &sport->port);
if (ret)
goto failed_attach_port;

ret = lpuart_global_reset(sport);
if (ret)
goto failed_reset;
Expand All @@ -2977,9 +2981,7 @@ static int lpuart_probe(struct platform_device *pdev)
sport->port.rs485.delay_rts_after_send)
dev_err(&pdev->dev, "driver doesn't support RTS delays\n");

ret = uart_add_one_port(&lpuart_reg, &sport->port);
if (ret)
goto failed_attach_port;
sport->port.rs485_config(&sport->port, &sport->port.rs485);

ret = devm_request_irq(&pdev->dev, sport->port.irq, handler, 0,
DRIVER_NAME, sport);
Expand All @@ -2989,10 +2991,10 @@ static int lpuart_probe(struct platform_device *pdev)
return 0;

failed_irq_request:
uart_remove_one_port(&lpuart_reg, &sport->port);
failed_attach_port:
failed_get_rs485:
failed_reset:
uart_remove_one_port(&lpuart_reg, &sport->port);
failed_attach_port:
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
Expand Down

0 comments on commit 0eb4504

Please sign in to comment.