From: Joel Stanley Date: Thu, 29 Jun 2017 06:01:07 +0000 (+0930) Subject: clk: gemini: Read status before using the value X-Git-Tag: v4.13-rc1~117^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=785b62167d2fb9f2b98432627e503d3759a48de9;p=karo-tx-linux.git clk: gemini: Read status before using the value The probe does a shift and mask of val without having read it from the hardware. Fixes: 846423f96721 ("clk: Add Gemini SoC clock controller") Signed-off-by: Joel Stanley Reviewed-by: Linus Walleij Signed-off-by: Stephen Boyd --- diff --git a/drivers/clk/clk-gemini.c b/drivers/clk/clk-gemini.c index b82db96ce0c7..c391a49aaaff 100644 --- a/drivers/clk/clk-gemini.c +++ b/drivers/clk/clk-gemini.c @@ -306,6 +306,7 @@ static int gemini_clk_probe(struct platform_device *pdev) gemini_clk_data->hws[GEMINI_CLK_RTC] = hw; /* CPU clock derived as a fixed ratio from the AHB clock */ + regmap_read(map, GEMINI_GLOBAL_STATUS, &val); val >>= CPU_AHB_RATIO_SHIFT; val &= CPU_AHB_RATIO_MASK; hw = clk_hw_register_fixed_factor(NULL, "cpu", "ahb", 0,