patch-2.4.23 linux-2.4.23/drivers/media/video/videodev.c

Next file: linux-2.4.23/drivers/message/fusion/linux_compat.h
Previous file: linux-2.4.23/drivers/media/video/tvmixer.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/drivers/media/video/videodev.c linux-2.4.23/drivers/media/video/videodev.c
@@ -62,6 +62,20 @@
 
 #endif /* CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS */
 
+struct video_device *video_device_alloc(void)
+{
+	struct video_device *vfd;
+	vfd = kmalloc(sizeof(*vfd),GFP_KERNEL);
+	if (NULL == vfd)
+		return NULL;
+	memset(vfd,0,sizeof(*vfd));
+	return vfd;
+}
+
+void video_device_release(struct video_device *vfd)
+{
+	kfree(vfd);
+}
 
 /*
  *	Read will do some smarts later on. Buffer pin etc.
@@ -611,6 +625,8 @@
 #endif
 
 	devfs_unregister (vfd->devfs_handle);
+	if (vfd->release)
+		vfd->release(vfd);
 	video_device[vfd->minor]=NULL;
 	MOD_DEC_USE_COUNT;
 	up(&videodev_lock);
@@ -661,6 +677,8 @@
 module_init(videodev_init)
 module_exit(videodev_exit)
 
+EXPORT_SYMBOL(video_device_alloc);
+EXPORT_SYMBOL(video_device_release);
 EXPORT_SYMBOL(video_register_device);
 EXPORT_SYMBOL(video_unregister_device);
 EXPORT_SYMBOL(video_devdata);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)