Hi Josh,
On 19/03/14 10:17, Josh Wu wrote:
On 3/15/2014 5:17 AM, Sylwester Nawrocki wrote:Oops, I missed somehow that it's v4l2_clk_get(), rather than
Thanks for the information. I will use this in v2 version.On 03/14/2014 11:12 AM, Josh Wu wrote:
You should instead make it:+ clk = v4l2_clk_get(&client->dev, "mclk");
+ if (IS_ERR(clk))
+ return -EPROBE_DEFER;
return PTR_ERR(clk);
But you will need this patch for that to work:
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/drivers/clk/clk.c?id=a34cd4666f3da84228a82f70c94b8d9b692034ea
With this patch there is no need to overwrite any returned error
value with EPROBE_DEFER.
clk_get(). So it seems it will not work when you return PTR_ERR(clk),
since v4l2_clk_get() returns -ENODEV when clock is not found.
I think we should modify v4l2_clk_get() so it returns EPROBE_DEFER
rather than ENODEV on error. I anticipate v4l2_clk_get() might be
using clk_get() internally in future, and the v4l2 clk look up
will be used as a fallback only. So sensor drivers should just
do something like:
clk = v4l2_clk_get(...);
if (IS_ERR(clk))
return PTR_ERR(clk);
--
Regards,
Sylwester