diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-05-02 08:01:04 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 12:58:57 -0300 |
commit | f2b305cd6711b7b3ce30db93b50bc5d6312950c8 (patch) | |
tree | fd70d24d94642f029024afd755e900b9264ff3b0 /drivers/media/video/hdpvr/hdpvr.h | |
parent | a2bdc5e6c4fefea6b0d576a4f610e47456647577 (diff) |
V4L/DVB: hdpvr: fix disconnect sequence
Disconnecting the HDPVR caused a kernel oops if lockdep was enabled.
In addition, if an app still had video0 open and attempted to call ioctl
when the device was already disconnected the system would crash.
Move the freeing and cleanup code to the release function: that is the
right place for it since you know when you get there that nobody is
using the device.
Also removed usb_set_intfdata: v4l2_device_register sets this already
to v4l2_dev.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/hdpvr/hdpvr.h')
-rw-r--r-- | drivers/media/video/hdpvr/hdpvr.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr.h b/drivers/media/video/hdpvr/hdpvr.h index 49ae25d83d1..b0f046df3cd 100644 --- a/drivers/media/video/hdpvr/hdpvr.h +++ b/drivers/media/video/hdpvr/hdpvr.h @@ -111,6 +111,11 @@ struct hdpvr_device { u8 *usbc_buf; }; +static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev) +{ + return container_of(v4l2_dev, struct hdpvr_device, v4l2_dev); +} + /* buffer one bulk urb of data */ struct hdpvr_buffer { |