From 7f8ecfab7a1d256707502207c56dd4bf3e3a026e Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 29 Aug 2008 17:31:35 -0300 Subject: V4L/DVB (8852): v4l2: use register_chrdev_region instead of register_chrdev Replace the old register_chrdev with the more flexible register_chrdev_region. Ensure that the release() is called when the very last chardev usage was released, and not when the sysfs devices were removed. This should simplify hotpluggable drivers considerably. Tested-by: Mike Isely Tested-by: Laurent Pinchart Signed-off-by: Hans Verkuil Acked-by: David Ellingsworth Reviewed-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-dev.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/media') diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index fb92e3d22d7..d129b56e1a9 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -47,6 +48,8 @@ struct video_device /* sysfs */ struct device dev; /* v4l device */ + struct cdev cdev; /* character device */ + void (*cdev_release)(struct kobject *kobj); struct device *parent; /* device parent */ /* device info */ -- cgit v1.2.3