Commit 1e512d45 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

serial: imx: add error messages when .probe fails

Some functions called by serial_imx_probe emit an error message themself
(like kmalloc() and friends). clk_prepare_enable() and
devm_request_irq() however don't which might make the driver silently
fail to probe. So add an error message for these.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b53761e3
...@@ -2137,8 +2137,10 @@ static int serial_imx_probe(struct platform_device *pdev) ...@@ -2137,8 +2137,10 @@ static int serial_imx_probe(struct platform_device *pdev)
/* For register access, we only need to enable the ipg clock. */ /* For register access, we only need to enable the ipg clock. */
ret = clk_prepare_enable(sport->clk_ipg); ret = clk_prepare_enable(sport->clk_ipg);
if (ret) if (ret) {
dev_err(&pdev->dev, "failed to enable per clk: %d\n", ret);
return ret; return ret;
}
/* Disable interrupts before requesting them */ /* Disable interrupts before requesting them */
reg = readl_relaxed(sport->port.membase + UCR1); reg = readl_relaxed(sport->port.membase + UCR1);
...@@ -2155,19 +2157,27 @@ static int serial_imx_probe(struct platform_device *pdev) ...@@ -2155,19 +2157,27 @@ static int serial_imx_probe(struct platform_device *pdev)
if (txirq > 0) { if (txirq > 0) {
ret = devm_request_irq(&pdev->dev, rxirq, imx_rxint, 0, ret = devm_request_irq(&pdev->dev, rxirq, imx_rxint, 0,
dev_name(&pdev->dev), sport); dev_name(&pdev->dev), sport);
if (ret) if (ret) {
dev_err(&pdev->dev, "failed to request rx irq: %d\n",
ret);
return ret; return ret;
}
ret = devm_request_irq(&pdev->dev, txirq, imx_txint, 0, ret = devm_request_irq(&pdev->dev, txirq, imx_txint, 0,
dev_name(&pdev->dev), sport); dev_name(&pdev->dev), sport);
if (ret) if (ret) {
dev_err(&pdev->dev, "failed to request tx irq: %d\n",
ret);
return ret; return ret;
}
} else { } else {
ret = devm_request_irq(&pdev->dev, rxirq, imx_int, 0, ret = devm_request_irq(&pdev->dev, rxirq, imx_int, 0,
dev_name(&pdev->dev), sport); dev_name(&pdev->dev), sport);
if (ret) if (ret) {
dev_err(&pdev->dev, "failed to request irq: %d\n", ret);
return ret; return ret;
} }
}
imx_ports[sport->port.line] = sport; imx_ports[sport->port.line] = sport;
......
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