From: Trent Piepho Date: Tue, 25 Jul 2006 23:37:03 +0000 (-0300) Subject: V4L/DVB (4379): Videodev: Check return value of class_device_register() correctly X-Git-Tag: v2.6.18-rc4~72^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c313111a2c843610f58d57b4e02159fecef4bbf;p=linux-2.6 V4L/DVB (4379): Videodev: Check return value of class_device_register() correctly Errors are return values < 0, not != 0. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 46848e2ae4..0fc90cd393 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c @@ -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); sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base); ret = class_device_register(&vfd->class_dev); - if (ret) { + if (ret < 0) { printk(KERN_ERR "%s: class_device_register failed\n", __FUNCTION__); goto fail_minor;