clk_get_rate() returns a ulong so do not attempt to pass negative error
codes through it.

Signed-off-by: Andrew Goodbody <[email protected]>
---
 drivers/clk/ti/clk-am3-dpll-x2.c | 4 ++--
 drivers/clk/ti/clk-divider.c     | 4 ++--
 drivers/clk/ti/clk-mux.c         | 2 +-
 drivers/clk/ti/clk-sci.c         | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/ti/clk-am3-dpll-x2.c b/drivers/clk/ti/clk-am3-dpll-x2.c
index 
1b0b9818cdd4d410bb0abf4ad8c3c5401b875147..dacde89efc490fb76f3a66c10af3348bc238eecc
 100644
--- a/drivers/clk/ti/clk-am3-dpll-x2.c
+++ b/drivers/clk/ti/clk-am3-dpll-x2.c
@@ -22,8 +22,8 @@ static ulong clk_ti_am3_dpll_x2_get_rate(struct clk *clk)
        unsigned long rate;
 
        rate = clk_get_rate(&priv->parent);
-       if (IS_ERR_VALUE(rate))
-               return rate;
+       if (!rate)
+               return 0;
 
        rate *= 2;
        dev_dbg(clk->dev, "rate=%ld\n", rate);
diff --git a/drivers/clk/ti/clk-divider.c b/drivers/clk/ti/clk-divider.c
index 
40a742d7fdc48ecf1c6b51913cc83cfa3d46e950..213be7dca30d7203dd36fbb95f4a0ac6592b5565
 100644
--- a/drivers/clk/ti/clk-divider.c
+++ b/drivers/clk/ti/clk-divider.c
@@ -216,8 +216,8 @@ static ulong clk_ti_divider_get_rate(struct clk *clk)
        u32 v;
 
        parent_rate = clk_get_rate(&priv->parent);
-       if (IS_ERR_VALUE(parent_rate))
-               return parent_rate;
+       if (!parent_rate)
+               return 0;
 
        v = clk_ti_readl(&priv->reg) >> priv->shift;
        v &= priv->mask;
diff --git a/drivers/clk/ti/clk-mux.c b/drivers/clk/ti/clk-mux.c
index 
db5393414318f11c193a5f498c60a2415ec6fabc..ea424a197c1065d928d13de11529fd5a27865def
 100644
--- a/drivers/clk/ti/clk-mux.c
+++ b/drivers/clk/ti/clk-mux.c
@@ -129,7 +129,7 @@ static ulong clk_ti_mux_get_rate(struct clk *clk)
        index = clk_ti_mux_get_index(clk);
        parent = clk_ti_mux_get_parent_by_index(&priv->parents, index);
        if (IS_ERR(parent))
-               return PTR_ERR(parent);
+               return 0;
 
        rate = clk_get_rate(parent);
        dev_dbg(clk->dev, "rate=%ld\n", rate);
diff --git a/drivers/clk/ti/clk-sci.c b/drivers/clk/ti/clk-sci.c
index 
e374bd3bcc20d140ca0e25d0ec63f3faeda06901..c055f6c678a58604d581a2fde3e5d94019d5c577
 100644
--- a/drivers/clk/ti/clk-sci.c
+++ b/drivers/clk/ti/clk-sci.c
@@ -76,7 +76,7 @@ static ulong ti_sci_clk_get_rate(struct clk *clk)
        ret = cops->get_freq(sci, clk->id, clk->data, &current_freq);
        if (ret) {
                dev_err(clk->dev, "%s: get_freq failed (%d)\n", __func__, ret);
-               return ret;
+               return 0;
        }
 
        debug("%s(current_freq=%llu)\n", __func__, current_freq);

-- 
2.47.3

Reply via email to