aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/ov511.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-06-15 10:04:00 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 19:07:40 -0300
commit163fe744c3283fd267268629afff4cfc846ed0e0 (patch)
tree4ad105db31f39491b5bb2f936c13416faf684121 /drivers/media/video/ov511.h
parenteccd15aad72f774b2059f708bc422dbb8493bb30 (diff)
V4L/DVB (11966): ov511: Fix unit_video parameter behavior
Fix a regression caused by changeset 9133:64aed7485a43 - v4l: disconnect kernel number from minor Before the above changeset, ov511_probe used to allow forcing to use a certain specific set of video devices, like: modprobe ov511 unit_video=4,1,3 num_uv=3 So, assuming that you have 5 ov511 devices, and connect they one by one, they'll gain the following device numbers (at the connection order): /dev/video4 /dev/video1 /dev/video3 /dev/video0 /dev/video2 However, this was changed due to this change at video_register_device(): + nr = find_next_zero_bit(video_nums[type], minor_cnt, nr == -1 ? 0 : nr); With the previous behavior, a trial to register on an already allocated mirror would fail, and a loop would get the next requested minor. However, the current behavior is to get the next available minor instead of failing. Due to that, this means that the above modprobe parameter will give, instead: /dev/video5 /dev/video6 /dev/video7 /dev/video8 /dev/video9 In order to restore the original behavior, a static var were added, storing the amount of already registered devices. While there, it also fixes the locking of the probe/disconnect functions. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ov511.h')
-rw-r--r--drivers/media/video/ov511.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/video/ov511.h b/drivers/media/video/ov511.h
index 70d99e52329..c450c92468d 100644
--- a/drivers/media/video/ov511.h
+++ b/drivers/media/video/ov511.h
@@ -494,6 +494,9 @@ struct usb_ov511 {
int has_decoder; /* Device has a video decoder */
int pal; /* Device is designed for PAL resolution */
+ /* ov511 device number ID */
+ int nr; /* Stores a device number */
+
/* I2C interface */
struct mutex i2c_lock; /* Protect I2C controller regs */
unsigned char primary_i2c_slave; /* I2C write id of sensor */