Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9f1612d3 authored by Shawn Guo's avatar Shawn Guo Committed by Mike Turquette
Browse files

clk: fix clk_get on of_clk_get_by_name return check



The commit 766e6a4e (clk: add DT clock binding support) plugs device
tree clk lookup of_clk_get_by_name into clk_get, and fall on non-DT
lookup clk_get_sys if DT lookup fails.

The return check on of_clk_get_by_name takes (clk != NULL) as a
successful DT lookup.  But it's not the case.  For any system that
does not define clk lookup in device tree, ERR_PTR(-ENOENT) will be
returned, and consequently, all the client drivers calling clk_get
in their probe functions will fail to probe with error code -ENOENT
returned.

Fix the issue by checking of_clk_get_by_name return with !IS_ERR(clk),
and update of_clk_get and of_clk_get_by_name for !CONFIG_OF build
correspondingly.

Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
Tested-by: default avatarMarek Vasut <marex@denx.de>
Tested-by: default avatarLauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
parent c782c384
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment