Commit 8c313111 authored by Trent Piepho's avatar Trent Piepho Committed by Mauro Carvalho Chehab

V4L/DVB (4379): Videodev: Check return value of class_device_register() correctly

Errors are return values < 0, not != 0.
Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 08d41808
...@@ -1575,7 +1575,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) ...@@ -1575,7 +1575,7 @@ int video_register_device(struct video_device *vfd, int type, int nr)
vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor);
sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base); sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base);
ret = class_device_register(&vfd->class_dev); ret = class_device_register(&vfd->class_dev);
if (ret) { if (ret < 0) {
printk(KERN_ERR "%s: class_device_register failed\n", printk(KERN_ERR "%s: class_device_register failed\n",
__FUNCTION__); __FUNCTION__);
goto fail_minor; goto fail_minor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment