summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2006-12-09 10:49:47 +1100
committerDave Airlie <airlied@linux.ie>2006-12-11 18:28:45 +1100
commit94f060bd0f78814f4daf8c7942bd710af52c7d6f (patch)
treec18ba952bebbaf73497d9cd593bb9d023e81331d /drivers/char
parent9202f32558601c2c99ddc438eb3218131d00d413 (diff)
downloadblackbird-obmc-linux-94f060bd0f78814f4daf8c7942bd710af52c7d6f.tar.gz
blackbird-obmc-linux-94f060bd0f78814f4daf8c7942bd710af52c7d6f.zip
drm: fix return value check
class_create() and class_device_create() return error code as a pointer on failure. These return values need to be checked by IS_ERR(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/drm/drm_sysfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/drm/drm_sysfs.c b/drivers/char/drm/drm_sysfs.c
index ba4b8de83cf0..cc8e2ebe128c 100644
--- a/drivers/char/drm/drm_sysfs.c
+++ b/drivers/char/drm/drm_sysfs.c
@@ -45,8 +45,8 @@ struct class *drm_sysfs_create(struct module *owner, char *name)
int err;
class = class_create(owner, name);
- if (!class) {
- err = -ENOMEM;
+ if (IS_ERR(class)) {
+ err = PTR_ERR(class);
goto err_out;
}
@@ -113,8 +113,8 @@ struct class_device *drm_sysfs_device_add(struct class *cs, drm_head_t *head)
MKDEV(DRM_MAJOR, head->minor),
&(head->dev->pdev)->dev,
"card%d", head->minor);
- if (!class_dev) {
- err = -ENOMEM;
+ if (IS_ERR(class_dev)) {
+ err = PTR_ERR(class_dev);
goto err_out;
}
OpenPOWER on IntegriCloud