cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_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>
This commit is contained in:
parent
cd664cc3a5
commit
1bae9958f8
1 changed files with 2 additions and 2 deletions
|
@ -266,9 +266,9 @@ static int __init omap_cpufreq_init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
mpu_dev = omap_device_get_by_hwmod_name("mpu");
|
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__);
|
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");
|
mpu_reg = regulator_get(mpu_dev, "vcc");
|
||||||
|
|
Loading…
Add table
Reference in a new issue