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: 6286bbb405 ("cpufreq: apple-soc: Add new driver to control Apple SoC CPU P-states")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Eric Curtin <ecurtin@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Dan Carpenter 2023-02-27 13:07:09 +03:00 committed by Rafael J. Wysocki
parent 5bd289f69b
commit f43523620f
1 changed files with 2 additions and 2 deletions

View File

@ -189,8 +189,8 @@ static int apple_soc_cpufreq_find_cluster(struct cpufreq_policy *policy,
*info = match->data; *info = match->data;
*reg_base = of_iomap(args.np, 0); *reg_base = of_iomap(args.np, 0);
if (IS_ERR(*reg_base)) if (!*reg_base)
return PTR_ERR(*reg_base); return -ENOMEM;
return 0; return 0;
} }