Commit f4352362 authored by Dan Carpenter's avatar Dan Carpenter Committed by Rafael J. Wysocki

cpufreq: apple-soc: Fix an IS_ERR() vs NULL check

The of_iomap() function returns NULL if it fails.  It never returns
error pointers.  Fix the check accordingly.

Fixes: 6286bbb4 ("cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarEric Curtin <ecurtin@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 5bd289f6
......@@ -189,8 +189,8 @@ static int apple_soc_cpufreq_find_cluster(struct cpufreq_policy *policy,
*info = match->data;
*reg_base = of_iomap(args.np, 0);
if (IS_ERR(*reg_base))
return PTR_ERR(*reg_base);
if (!*reg_base)
return -ENOMEM;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment