From: Heiko Stuebner Date: Thu, 16 Apr 2015 19:45:34 +0000 (-0700) Subject: drivers/rtc/rtc-hym8563.c: return clock rate even when clock is disabled X-Git-Tag: firefly_0821_release~176^2~1948^2~86 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b3288a43b4dacd2b4d2b24726d7b469d8ade5120;p=firefly-linux-kernel-4.4.55.git drivers/rtc/rtc-hym8563.c: return clock rate even when clock is disabled When the clock is disabled, do not return a rate of 0 but instead return the rate the clock will be running at after it gets enabled. This prevents problems when the core clock code is trying to determine a suitable rate, while the clock is still off. Signed-off-by: Heiko Stuebner Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index b936bb4096b5..d4a65619ef14 100644 --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c @@ -309,7 +309,7 @@ static unsigned long hym8563_clkout_recalc_rate(struct clk_hw *hw, struct i2c_client *client = hym8563->client; int ret = i2c_smbus_read_byte_data(client, HYM8563_CLKOUT); - if (ret < 0 || ret & HYM8563_CLKOUT_DISABLE) + if (ret < 0) return 0; ret &= HYM8563_CLKOUT_MASK;