projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb53237
)
c2port: fix device_create() return value check
author
Jani Nikula
<
[email protected]
>
Tue, 23 Mar 2010 20:35:27 +0000
(13:35 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 24 Mar 2010 23:31:21 +0000
(16:31 -0700)
Use IS_ERR() instead of comparing to NULL.
[
[email protected]
: preserve the error code]
Signed-off-by: Jani Nikula <
[email protected]
>
Cc: Vegard Nossum <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/misc/c2port/core.c
patch
|
blob
|
history
diff --git
a/drivers/misc/c2port/core.c
b/drivers/misc/c2port/core.c
index b5346b4db91a2021d43c470b09bd53fbdc7a4170..b7a85f46a6c2c913d7dc39b8c563daef27ded8d0 100644
(file)
--- a/
drivers/misc/c2port/core.c
+++ b/
drivers/misc/c2port/core.c
@@
-912,8
+912,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);