ARM: OMAP3: Beagle: fix return value check in beagle_opp_init()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 30 Oct 2013 05:23:21 +0000 (13:23 +0800)
committerTony Lindgren <tony@atomide.com>
Fri, 15 Nov 2013 15:38:14 +0000 (07:38 -0800)
In case of error, the function get_cpu_device() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-omap3beagle.c

index 8b9cd0690ce79328d12c664e1ef2ef301ef0b7eb..09f6149b59a957f618d664779aff8e6c9957d633 100644 (file)
@@ -510,7 +510,7 @@ static int __init beagle_opp_init(void)
                mpu_dev = get_cpu_device(0);
                iva_dev = omap_device_get_by_hwmod_name("iva");
 
-               if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
+               if (!mpu_dev || IS_ERR(iva_dev)) {
                        pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
                                __func__, mpu_dev, iva_dev);
                        return -ENODEV;