X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fvideodev.c;h=4c3f92605a82b4173bd79112e7578b7f2bf01a61;hb=3117beec7e43f91ce156cacf033a712c7e22737d;hp=2dfa7f23d0ca28f7e08a2fa7167184789c32cc29;hpb=4854c7b27f0975a2b629f35ea3996d2968eb7c4f;p=linux-2.6-omap-h63xx.git diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 2dfa7f23d0c..4c3f92605a8 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -1513,6 +1512,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) int i=0; int base; int end; + int ret; char *name_base; switch(type) @@ -1563,10 +1563,6 @@ int video_register_device(struct video_device *vfd, int type, int nr) video_device[i]=vfd; vfd->minor=i; mutex_unlock(&videodev_lock); - - sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); - devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor), - S_IFCHR | S_IRUSR | S_IWUSR, vfd->devfs_name); mutex_init(&vfd->lock); /* sysfs class */ @@ -1575,10 +1571,14 @@ int video_register_device(struct video_device *vfd, int type, int nr) vfd->class_dev.dev = vfd->dev; vfd->class_dev.class = &video_class; vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); - strlcpy(vfd->class_dev.class_id, vfd->devfs_name + 4, BUS_ID_SIZE); - class_device_register(&vfd->class_dev); - class_device_create_file(&vfd->class_dev, - &class_device_attr_name); + sprintf(vfd->class_dev.class_id, "%s%d", name_base, i - base); + ret = class_device_register(&vfd->class_dev); + if (ret) { + printk(KERN_ERR "%s: class_device_register failed\n", + __FUNCTION__); + return ret; + } + video_device_create_file(vfd, &class_device_attr_name); #if 1 /* needed until all drivers are fixed */ @@ -1604,7 +1604,6 @@ void video_unregister_device(struct video_device *vfd) if(video_device[vfd->minor]!=vfd) panic("videodev: bad unregister"); - devfs_remove(vfd->devfs_name); video_device[vfd->minor]=NULL; class_device_unregister(&vfd->class_dev); mutex_unlock(&videodev_lock);