alistair23-linux/drivers/clk
Shawn Guo 9f1612d351 clk: fix clk_get on of_clk_get_by_name return check
The commit 766e6a4 (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: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Tested-by: Marek Vasut <marex@denx.de>
Tested-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
2012-07-19 14:07:45 -07:00
..
mxs Merge branch 'clk/mxs-for-3.6' of git://git.linaro.org/people/shawnguo/linux-2.6 into clk-next 2012-07-12 09:48:19 -07:00
spear clk: SPEAr600: Fix ethernet clock name for DT based probing 2012-06-25 16:51:47 -07:00
versatile ARM: integrator: convert to common clock 2012-07-11 17:58:45 -07:00
clk-divider.c clk: Add CLK_IS_BASIC flag to identify basic clocks 2012-07-11 15:36:43 -07:00
clk-fixed-factor.c clk: Add CLK_IS_BASIC flag to identify basic clocks 2012-07-11 15:36:43 -07:00
clk-fixed-rate.c clk: add DT fixed-clock binding support 2012-07-11 17:58:46 -07:00
clk-gate.c clk: Add CLK_IS_BASIC flag to identify basic clocks 2012-07-11 15:36:43 -07:00
clk-highbank.c clk: add highbank clock support 2012-07-11 17:58:47 -07:00
clk-mux.c clk: Add CLK_IS_BASIC flag to identify basic clocks 2012-07-11 15:36:43 -07:00
clk-u300.c ARM: u300: convert to common clock 2012-07-11 15:36:45 -07:00
clk-wm831x.c clk: wm831x: Add initial WM831x clock driver 2012-07-11 15:36:44 -07:00
clk.c clk: add DT clock binding support 2012-07-11 17:58:45 -07:00
clkdev.c clk: fix clk_get on of_clk_get_by_name return check 2012-07-19 14:07:45 -07:00
Kconfig clk: wm831x: Add initial WM831x clock driver 2012-07-11 15:36:44 -07:00
Makefile clk: add highbank clock support 2012-07-11 17:58:47 -07:00