Skip to contentSkip to conversation

clk: divider: return real rate instead of divider value

PATCH Applied Heiko Stübner 4 participants 4 messages Feb 24, 2015 – Mar 6, 2015 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: divider: return real rate instead of divider value

Commit bca9690b9426 ("clk: divider: Make generic for usage elsewhere") returned only the divider value for read-only dividers instead of the actual rate.

Fixes bca9690b9426 ("clk: divider: Make generic for usage elsewhere")
---
 drivers/clk/clk-divider.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-divider.c +1 -1
index a213455..5b4c018 100644
@@ -355,7 +355,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
 		bestdiv = readl(divider->reg) >> divider->shift;
 		bestdiv &= div_mask(divider->width);
 		bestdiv = _get_div(divider->table, bestdiv, divider->flags);
-		return bestdiv;
+		return DIV_ROUND_UP(*prate, bestdiv);
 	}
 
 	return divider_round_rate(hw, rate, prate, divider->table,
Signature · 1 line
2.1.4
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · Heiko St?bner

Commit bca9690b9426 ("clk: divider: Make generic for usage elsewhere") returned only the divider value for read-only dividers instead of the actual rate.

Fixes bca9690b9426 ("clk: divider: Make generic for usage elsewhere")

I just created an identical patch, so

Thanks
James

Quoted 26 lines
---
 drivers/clk/clk-divider.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-divider.c +1 -2
index a213455..5b4c018 100644
@@ -355,7 +355,7 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
                bestdiv = readl(divider->reg) >> divider->shift;
                bestdiv &= div_mask(divider->width);
                bestdiv = _get_div(divider->table, bestdiv, divider->flags);
-               return bestdiv;
+               return DIV_ROUND_UP(*prate, bestdiv);
        }
 
        return divider_round_rate(hw, rate, prate, divider->table,
--

2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Acked-by on v1 1/1
#2 lore raw
In reply to Heiko Stübner
Quoted 7 lines · Heiko St?bner

Commit bca9690b9426 ("clk: divider: Make generic for usage elsewhere") returned only the divider value for read-only dividers instead of the actual rate.

Fixes bca9690b9426 ("clk: divider: Make generic for usage elsewhere")

Oops. Thanks.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#3 lore raw

Quoting Stephen Boyd (2015-02-25 16:13:15)

Quoted 5 lines · Heiko St?bner
Quoted 4 lines

Commit bca9690b9426 ("clk: divider: Make generic for usage elsewhere") returned only the divider value for read-only dividers instead of the actual rate.

Quoted 7 lines
Quoted 3 lines
Fixes bca9690b9426 ("clk: divider: Make generic for usage elsewhere")

Oops. Thanks.

Applied to clk-fixes.

Regards,
Mike

Quoted 5 lines
Signature · 3 lines
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project