V4L: pvrusb2: Solve mutex deadlock
There is a mutex ordering problem between the pvrusb2 driver and the
v4l core. Two different pathways take mutexes in opposing orders and
this (under rare circumstances) can cause a deadlock. The two mutexes
in question are videodev_lock in the v4l core and device_lock inside
the pvrusb2 driver. The device_lock instance in the driver protects a
private global array of context pointers which had been implemented in
advance of v4l core changes which eliminate the video_set_drvdata()
and video_get_drvdata() functions.
This patch restores the use of video_get_drvdata() and
video_set_drvdata(), eliminating the need for the array and the mutex.
(This is actually a patch to restore the previous implementation.) We
can do this for 2.6.18 since those functions are in fact still
present. A better (and larger) solution will be done for later
kernels.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>