aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/c2port/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/c2port/core.c')
-rw-r--r--drivers/misc/c2port/core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c
index b5346b4db91..ed090e77c9c 100644
--- a/drivers/misc/c2port/core.c
+++ b/drivers/misc/c2port/core.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/idr.h>
#include <linux/sched.h>
+#include <linux/slab.h>
#include <linux/c2port.h>
@@ -912,8 +913,8 @@ struct c2port_device *c2port_device_register(char *name,
c2dev->dev = device_create(c2port_class, NULL, 0, c2dev,
"c2port%d", id);
- if (unlikely(!c2dev->dev)) {
- ret = -ENOMEM;
+ if (unlikely(IS_ERR(c2dev->dev))) {
+ ret = PTR_ERR(c2dev->dev);
goto error_device_create;
}
dev_set_drvdata(c2dev->dev, c2dev);