clk: Remove clock ID check in .get_rate() of clk_fixed_*
authorLukasz Majewski <lukma@denx.de>
Mon, 24 Jun 2019 13:50:37 +0000 (15:50 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 19 Jul 2019 12:50:30 +0000 (14:50 +0200)
This check requires the struct clk passed to .get_rate() to be always
cleared out as any clock with valid ID causes -EINVAL return value.

The return code of fixed clocks shall always be returned.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/clk_fixed_factor.c
drivers/clk/clk_fixed_rate.c

index 5fa20a84dbb02bf0ee85331e44f723d64dcbfc36..dcdb6ddf5cf898d40ffec551b0c742b55734e58e 100644 (file)
@@ -24,9 +24,6 @@ static ulong clk_fixed_factor_get_rate(struct clk *clk)
        uint64_t rate;
        struct clk_fixed_factor *ff = to_clk_fixed_factor(clk->dev);
 
-       if (clk->id != 0)
-               return -EINVAL;
-
        rate = clk_get_rate(&ff->parent);
        if (IS_ERR_VALUE(rate))
                return rate;
index d8d9f86c8642c927bce696ab97d111090895d8d0..50dbb136557c9de8228ddd397cd2893c1610bee6 100644 (file)
@@ -15,9 +15,6 @@ struct clk_fixed_rate {
 
 static ulong clk_fixed_rate_get_rate(struct clk *clk)
 {
-       if (clk->id != 0)
-               return -EINVAL;
-
        return to_clk_fixed_rate(clk->dev)->fixed_rate;
 }