Commit 4977d1c6 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] devfs: videodev

parent e8095bf2
...@@ -375,7 +375,6 @@ int video_register_device(struct video_device *vfd, int type, int nr) ...@@ -375,7 +375,6 @@ int video_register_device(struct video_device *vfd, int type, int nr)
int base; int base;
int end; int end;
char *name_base; char *name_base;
char name[16];
switch(type) switch(type)
{ {
...@@ -426,19 +425,19 @@ int video_register_device(struct video_device *vfd, int type, int nr) ...@@ -426,19 +425,19 @@ int video_register_device(struct video_device *vfd, int type, int nr)
vfd->minor=i; vfd->minor=i;
up(&videodev_lock); up(&videodev_lock);
sprintf (name, "v4l/%s%d", name_base, i - base); sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base);
vfd->devfs_handle = devfs_register(NULL, vfd->devfs_name, 0, VIDEO_MAJOR, vfd->minor,
devfs_register (NULL, name, DEVFS_FL_DEFAULT, S_IFCHR | S_IRUSR | S_IWUSR, &video_fops, NULL);
VIDEO_MAJOR, vfd->minor,
S_IFCHR | S_IRUSR | S_IWUSR,
&video_fops,
NULL);
init_MUTEX(&vfd->lock); init_MUTEX(&vfd->lock);
#ifdef CONFIG_VIDEO_PROC_FS #ifdef CONFIG_VIDEO_PROC_FS
sprintf (name, "%s%d", name_base, i - base); {
videodev_proc_create_dev (vfd, name); char name[16];
sprintf(name, "%s%d", name_base, i - base);
videodev_proc_create_dev(vfd, name);
}
#endif #endif
return 0; return 0;
} }
...@@ -460,7 +459,7 @@ void video_unregister_device(struct video_device *vfd) ...@@ -460,7 +459,7 @@ void video_unregister_device(struct video_device *vfd)
videodev_proc_destroy_dev (vfd); videodev_proc_destroy_dev (vfd);
#endif #endif
devfs_unregister (vfd->devfs_handle); devfs_remove(vfd->devfs_name);
video_device[vfd->minor]=NULL; video_device[vfd->minor]=NULL;
up(&videodev_lock); up(&videodev_lock);
} }
......
...@@ -39,7 +39,7 @@ struct video_device ...@@ -39,7 +39,7 @@ struct video_device
/* for videodev.c intenal usage -- don't touch */ /* for videodev.c intenal usage -- don't touch */
int users; int users;
struct semaphore lock; struct semaphore lock;
devfs_handle_t devfs_handle; char devfs_name[64]; /* devfs */
}; };
#define VIDEO_MAJOR 81 #define VIDEO_MAJOR 81
......
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