aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorJani Nikula <ext-jani.1.nikula@nokia.com>2010-03-23 16:35:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-24 19:31:21 -0400
commit8c363afe94b885d39ae2e93e41680282a470ad84 (patch)
treeccd3f3a6a26f560c43d5b6c0f2ecdad22d9514e4 /drivers/misc
parentcb53237513bd1e090cce120efe12ede72c932b5f (diff)
c2port: fix device_create() return value check
Use IS_ERR() instead of comparing to NULL. [akpm@linux-foundation.org: preserve the error code] Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Cc: Vegard Nossum <vegard.nossum@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/c2port/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index b5346b4db91a..b7a85f46a6c2 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -912,8 +912,8 @@ struct c2port_device *c2port_device_register(char *name,
912 912
913 c2dev->dev = device_create(c2port_class, NULL, 0, c2dev, 913 c2dev->dev = device_create(c2port_class, NULL, 0, c2dev,
914 "c2port%d", id); 914 "c2port%d", id);
915 if (unlikely(!c2dev->dev)) { 915 if (unlikely(IS_ERR(c2dev->dev))) {
916 ret = -ENOMEM; 916 ret = PTR_ERR(c2dev->dev);
917 goto error_device_create; 917 goto error_device_create;
918 } 918 }
919 dev_set_drvdata(c2dev->dev, c2dev); 919 dev_set_drvdata(c2dev->dev, c2dev);