Skip to contentSkip to conversation

ARM: OMAP: fix return value check in beagle_opp_init()

PATCH New Wei Yongjun 2 participants 3 messages Sep 21, 2012 – Oct 2, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in beagle_opp_init()

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_get_by_hwmod_name() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

---
 arch/arm/mach-omap2/board-omap3beagle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/board-omap3beagle.c +1 -1
index 6202fc7..a548d70 100644
@@ -466,7 +466,7 @@ static void __init beagle_opp_init(void)
 		mpu_dev = omap_device_get_by_hwmod_name("mpu");
 		iva_dev = omap_device_get_by_hwmod_name("iva");
 
-		if (!mpu_dev || !iva_dev) {
+		if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
 			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
 				__func__, mpu_dev, iva_dev);
 			return;
#1 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in beagle_opp_init()

Quoted 10 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_get_by_hwmod_name() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Quoted 23 lines
---
 arch/arm/mach-omap2/board-omap3beagle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/board-omap3beagle.c +1 -2
index 6202fc7..a548d70 100644
@@ -466,7 +466,7 @@ static void __init beagle_opp_init(void)
 		mpu_dev = omap_device_get_by_hwmod_name("mpu");
 		iva_dev = omap_device_get_by_hwmod_name("iva");
 
-		if (!mpu_dev || !iva_dev) {
+		if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
 			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
 				__func__, mpu_dev, iva_dev);
 			return;
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH 1/1 ARM: OMAP: fix return value check in beagle_opp_init()

In reply to Wei Yongjun
Quoted 10 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

In case of error, the function omap_device_get_by_hwmod_name() returns ERR_PTR() not NULL pointer. The NULL test in the return value check should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Thanks, queueing this up for v3.7-rc.

Kevin

Quoted 23 lines
---
 arch/arm/mach-omap2/board-omap3beagle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/board-omap3beagle.c +1 -2
index 6202fc7..a548d70 100644
@@ -466,7 +466,7 @@ static void __init beagle_opp_init(void)
 		mpu_dev = omap_device_get_by_hwmod_name("mpu");
 		iva_dev = omap_device_get_by_hwmod_name("iva");
 
-		if (!mpu_dev || !iva_dev) {
+		if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) {
 			pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
 				__func__, mpu_dev, iva_dev);
 			return;
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html