diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-14 12:28:45 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-14 12:28:45 +0100 |
commit | 48beb6bb3e66daddf4c339f5c02710a060d3a0be (patch) | |
tree | 6af556d0d546f47fd7bd64db2daafb5b2b6e74ea /linux/include | |
parent | 0f2ea07a22d87dcff3529fd787f8b41ed665bb28 (diff) | |
download | mediapointer-dvb-s2-48beb6bb3e66daddf4c339f5c02710a060d3a0be.tar.gz mediapointer-dvb-s2-48beb6bb3e66daddf4c339f5c02710a060d3a0be.tar.bz2 |
v4l2-device: add v4l2_device_disconnect
From: Hans Verkuil <hverkuil@xs4all.nl>
Call v4l2_device_disconnect when the parent of a hotpluggable device
disconnects. This ensures that you do not have a pointer to a device that
is no longer present.
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/include')
-rw-r--r-- | linux/include/media/v4l2-device.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/include/media/v4l2-device.h b/linux/include/media/v4l2-device.h index 3d8e96f6c..0dd3e8e86 100644 --- a/linux/include/media/v4l2-device.h +++ b/linux/include/media/v4l2-device.h @@ -53,7 +53,11 @@ struct v4l2_device { dev may be NULL in rare cases (ISA devices). In that case you must fill in the v4l2_dev->name field before calling this function. */ int __must_check v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev); -/* Set v4l2_dev->dev->driver_data to NULL and unregister all sub-devices */ +/* Set v4l2_dev->dev to NULL. Call when the USB parent disconnects. + Since the parent disappears this ensures that v4l2_dev doesn't have an + invalid parent pointer. */ +void v4l2_device_disconnect(struct v4l2_device *v4l2_dev); +/* Unregister all sub-devices and any other resources related to v4l2_dev. */ void v4l2_device_unregister(struct v4l2_device *v4l2_dev); /* Register a subdev with a v4l2 device. While registered the subdev module |