Commit 1c703225 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Stephen Boyd

clk: max77686: fix number of clocks setup for clk_hw based registration

The commit 9b4cac33 ("clk: max77686: Migrate to clk_hw based OF and
registration APIs") converted the driver to use the new provider API to
register clocks using clk_hw.

But unfortunately, in the conversion it missed to set the num_clks value
which lead to the following error when trying to register a clk provider:

[    1.963782] of_clk_max77686_get: invalid index 0
[    1.967460] ERROR: could not get clock /rtc@10070000:rtc_src(1)
[    1.973638] s3c-rtc 10070000.rtc: failed to find rtc source clock

Fix it by correctly set the max77686_clk_driver_data num_clks member.

Fixes: 9b4cac33 ("clk: max77686: Migrate to clk_hw based OF and registration APIs")
Reported-by: default avatarMarkus Reichl <m.reichl@fivetechno.de>
Suggested-by: default avatarTobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Tested-by: default avatarMarkus Reichl <m.reichl@fivetechno.de>
Reviewed-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 981e1bea
...@@ -216,6 +216,7 @@ static int max77686_clk_probe(struct platform_device *pdev) ...@@ -216,6 +216,7 @@ static int max77686_clk_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
drv_data->num_clks = num_clks;
drv_data->max_clk_data = devm_kcalloc(dev, num_clks, drv_data->max_clk_data = devm_kcalloc(dev, num_clks,
sizeof(*drv_data->max_clk_data), sizeof(*drv_data->max_clk_data),
GFP_KERNEL); GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment