public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/BSR: fix device_create() return value check
@ 2010-03-11 16:15 Jani Nikula
  2010-03-11 21:21 ` Sonny Rao
  0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2010-03-11 16:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: sonnyrao, benh, tklauser, jkosina, ext-jani.1.nikula

From: Jani Nikula <ext-jani.1.nikula@nokia.com>

Use IS_ERR() instead of comparing to NULL.

Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com>

---

NOTE: I'm afraid I'm unable to test this; please consider this more a
bug report than a complete patch.
---
 drivers/char/bsr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index c02db01..3b31f74 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -252,7 +252,7 @@ static int bsr_add_node(struct device_node *bn)
 
 		cur->bsr_device = device_create(bsr_class, NULL, cur->bsr_dev,
 						cur, cur->bsr_name);
-		if (!cur->bsr_device) {
+		if (IS_ERR(cur->bsr_device)) {
 			printk(KERN_ERR "device_create failed for %s\n",
 			       cur->bsr_name);
 			cdev_del(&cur->bsr_cdev);
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-15 14:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11 16:15 [PATCH] powerpc/BSR: fix device_create() return value check Jani Nikula
2010-03-11 21:21 ` Sonny Rao
2010-03-15 14:24   ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox