mirror of
https://github.com/torvalds/linux.git
synced 2026-10-23 15:32:04 +02:00
pmdomain: rockchip: don't ignore clock lookup errors on attach
rockchip_pd_attach_dev() treated every of_clk_get() error as the end
of the clock list, so a clock that exists but is not available yet
(e.g. -EPROBE_DEFER) was silently skipped and the device ended up
without pm_clk management. Only -ENOENT means there are no more
clocks.
Fixes: 7c696693a4 ("soc: rockchip: power-domain: Add power domain driver")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
This commit is contained in:
parent
d8b3847770
commit
4c66c42359
|
|
@ -759,7 +759,19 @@ static int rockchip_pd_attach_dev(struct generic_pm_domain *genpd,
|
|||
}
|
||||
|
||||
i = 0;
|
||||
while ((clk = of_clk_get(dev->of_node, i++)) && !IS_ERR(clk)) {
|
||||
while (1) {
|
||||
clk = of_clk_get(dev->of_node, i++);
|
||||
if (IS_ERR(clk)) {
|
||||
error = PTR_ERR(clk);
|
||||
if (error == -ENOENT)
|
||||
break;
|
||||
|
||||
dev_err(dev, "failed to get clock %d: %d\n", i - 1,
|
||||
error);
|
||||
pm_clk_destroy(dev);
|
||||
return error;
|
||||
}
|
||||
|
||||
dev_dbg(dev, "adding clock '%pC' to list of PM clocks\n", clk);
|
||||
error = pm_clk_add_clk(dev, clk);
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user