summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRamon Fried <ramon.fried@gmail.com>2018-05-16 12:13:37 +0300
committerTom Rini <trini@konsulko.com>2018-05-26 12:46:50 -0400
commit11d59fe5374a1a35d6293951794e32f0c0126739 (patch)
treeac51de8a735a9f5c7404b1342a9b94936a8d31ae /drivers
parentffada23ca7fe6f0cff960bbb1288060d227f2d93 (diff)
downloadu-boot-11d59fe5374a1a35d6293951794e32f0c0126739.tar.gz
u-boot-11d59fe5374a1a35d6293951794e32f0c0126739.tar.xz
u-boot-11d59fe5374a1a35d6293951794e32f0c0126739.zip
serial: serial_msm: fail probe if settings clocks fails
Failure to set the clocks will causes data abort exception when trying to write to AHB uart registers. This patch ensures that we don't touch these registers if clock setting failed. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/serial_msm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
index 119e6b9846..8b585deeeb 100644
--- a/drivers/serial/serial_msm.c
+++ b/drivers/serial/serial_msm.c
@@ -181,10 +181,12 @@ static int msm_uart_clk_init(struct udevice *dev)
static int msm_serial_probe(struct udevice *dev)
{
+ int ret;
struct msm_serial_data *priv = dev_get_priv(dev);
- msm_uart_clk_init(dev); /* Ignore return value and hope clock was
- properly initialized by earlier loaders */
+ ret = msm_uart_clk_init(dev);
+ if (ret)
+ return ret;
if (readl(priv->base + UARTDM_SR) & UARTDM_SR_UART_OVERRUN)
writel(UARTDM_CR_CMD_RESET_ERR, priv->base + UARTDM_CR);