Skip to content

Commit

Permalink
cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_…
Browse files Browse the repository at this point in the history
…hwmod_name

omap_device_get_by_hwmod_name() returns ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Axel Lin authored and Rafael J. Wysocki committed Sep 19, 2012
1 parent cd664cc commit 1bae995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/cpufreq/omap-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ static int __init omap_cpufreq_init(void)
}

mpu_dev = omap_device_get_by_hwmod_name("mpu");
if (!mpu_dev) {
if (IS_ERR(mpu_dev)) {
pr_warning("%s: unable to get the mpu device\n", __func__);
return -EINVAL;
return PTR_ERR(mpu_dev);
}

mpu_reg = regulator_get(mpu_dev, "vcc");
Expand Down

0 comments on commit 1bae995

Please sign in to comment.