diff options
| author | Casey Connolly <[email protected]> | 2026-03-20 16:45:40 +0100 |
|---|---|---|
| committer | Casey Connolly <[email protected]> | 2026-03-24 11:49:17 +0100 |
| commit | 7f09aff39924c9bce4ac12379c5f624ce7004d43 (patch) | |
| tree | 74ab48594b6596621f19e23c00a89b7f8029aaaa /drivers/serial | |
| parent | bb5012fb66cae854d05334c3f8787b093f0c7b92 (diff) | |
serial: msm-geni: allow invalid clock
Pre-relocation we may not have a clock but it's usually been enabled for
us already, or worst case we will enable it after relocation. Erroring
out in this case will almost always cause U-Boot to hang pre-relocation
which is undesirable and may be hard to debug.
Link: https://patch.msgid.link/20260320-casey-qcom-rpmh-serial-fixes-v1-1-b81d05832eec@linaro.org
Signed-off-by: Casey Connolly <[email protected]>
Diffstat (limited to 'drivers/serial')
| -rw-r--r-- | drivers/serial/serial_msm_geni.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c index bb5a2cb4d2c..3dca581f68f 100644 --- a/drivers/serial/serial_msm_geni.c +++ b/drivers/serial/serial_msm_geni.c @@ -212,7 +212,7 @@ static int msm_serial_setbrg(struct udevice *dev, int baud) ret = clk_set_rate(priv->se, clk_rate); if (ret < 0) { pr_err("%s: Couldn't set clock rate: %d\n", __func__, ret); - return ret; + return 0; } geni_serial_baud(priv->base, clk_div, baud); @@ -517,13 +517,14 @@ static int msm_serial_probe(struct udevice *dev) u32 proto; struct clk *clk; - clk = devm_clk_get(dev, NULL); + clk = devm_clk_get_optional(dev, NULL); if (IS_ERR(clk)) - return PTR_ERR(clk); - priv->se = clk; + dev_dbg(dev, "Couldn't find UART clock: %ld", PTR_ERR(clk)); + else + priv->se = clk; /* Try enable clock */ - ret = clk_enable(clk); + clk_enable(clk); /* Check if firmware loading is needed (BT UART) */ proto = readl(priv->base + GENI_FW_REVISION_RO); @@ -547,10 +548,6 @@ static int msm_serial_probe(struct udevice *dev) if (ofnode_device_is_compatible(dev_ofnode(dev), "qcom,geni-uart")) return -ENOENT; - /* Now handle clock enable return value */ - if (ret) - return ret; - ret = geni_set_oversampling(dev); if (ret < 0) return ret; |
