lkml.org 
[lkml]   [2013]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440
On Thu, Mar 07, 2013 at 04:28:00PM +0100, Sylwester Nawrocki wrote:
> On 03/07/2013 05:13 AM, Amit Daniel Kachhap wrote:
> > + dvfs_info->cpu_clk = devm_clk_get(dvfs_info->dev, "armclk");
> > + if (IS_ERR_OR_NULL(dvfs_info->cpu_clk)) {
>
> devm_clk_get() return value needs to be checked with IS_ERR(),
> not IS_ERR_OR_NULL().
>
> > + pr_err("Failed to get cpu clock\n");
> > + ret = PTR_ERR(dvfs_info->cpu_clk);
> > + goto err_free_table;

Amit, to illustrate why this is wrong, consider this:
1. Set cpu_clk to NULL.
2. Realise IS_ERR_OR_NULL(NULL) is true.
3. What is the value of PTR_ERR(NULL) ?
4. What effect does that have when you jump to err_free_table ?
5. What value is returned from this function in that case ?
6. What does that return value mean to the driver core ?


\
 
 \ /
  Last update: 2013-03-07 17:01    [W:0.073 / U:1.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site