From: Philipp Zabel
Date: Tue, 7 Nov 2017 12:12:17 +0000 (+0100)
Subject: rtc: pcf8563: fix output clock rate
X-Git-Tag: v4.15-rc1~24^2~9
X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a3350f9c57ffad569c40f7320b89da1f3061c5bb;p=thirdparty%2Fkernel%2Fstable.git
rtc: pcf8563: fix output clock rate
The pcf8563_clkout_recalc_rate function erroneously ignores the
frequency index read from the CLKO register and always returns
32768 Hz.
Fixes: a39a6405d5f9 ("rtc: pcf8563: add CLKOUT to common clock framework")
Signed-off-by: Philipp Zabel
Signed-off-by: Alexandre Belloni
---
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index cea6ea4df970f..8c836c51a508f 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -422,7 +422,7 @@ static unsigned long pcf8563_clkout_recalc_rate(struct clk_hw *hw,
return 0;
buf &= PCF8563_REG_CLKO_F_MASK;
- return clkout_rates[ret];
+ return clkout_rates[buf];
}
static long pcf8563_clkout_round_rate(struct clk_hw *hw, unsigned long rate,