diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-09-07 11:49:59 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:37:01 -0400 |
commit | 176c2f34157a8d8b252c8f0bc242457c971b06a1 (patch) | |
tree | 4a78681b9d4dc4fb58eef5c3055f3268368476b1 /drivers/media/video/bt8xx | |
parent | c87994db017a5a28af2edd043669a371d800919e (diff) |
V4L/DVB (8956): bttv: Turn video_nr, vbi_nr and radio_nr into arrays
With video_nr, vbi_nr and radio_nr being simple integers, it is not
possible to use these parameters on a system with multiple bttv
adapters (which happens to be my case.) video_register_device() will
always fail on the second and later adapters. Turn these parameters
into arrays, as many other V4L drivers are already doing, so that they
can be used on such systems.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-driver.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index ef205cd2a2a7..9bb247cdc28b 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c | |||
@@ -76,9 +76,9 @@ static unsigned int gbuffers = 8; | |||
76 | static unsigned int gbufsize = 0x208000; | 76 | static unsigned int gbufsize = 0x208000; |
77 | static unsigned int reset_crop = 1; | 77 | static unsigned int reset_crop = 1; |
78 | 78 | ||
79 | static int video_nr = -1; | 79 | static int video_nr[BTTV_MAX] = { [0 ... (BTTV_MAX-1)] = -1 }; |
80 | static int radio_nr = -1; | 80 | static int radio_nr[BTTV_MAX] = { [0 ... (BTTV_MAX-1)] = -1 }; |
81 | static int vbi_nr = -1; | 81 | static int vbi_nr[BTTV_MAX] = { [0 ... (BTTV_MAX-1)] = -1 }; |
82 | static int debug_latency; | 82 | static int debug_latency; |
83 | 83 | ||
84 | static unsigned int fdsr; | 84 | static unsigned int fdsr; |
@@ -108,9 +108,6 @@ module_param(irq_debug, int, 0644); | |||
108 | module_param(debug_latency, int, 0644); | 108 | module_param(debug_latency, int, 0644); |
109 | 109 | ||
110 | module_param(fdsr, int, 0444); | 110 | module_param(fdsr, int, 0444); |
111 | module_param(video_nr, int, 0444); | ||
112 | module_param(radio_nr, int, 0444); | ||
113 | module_param(vbi_nr, int, 0444); | ||
114 | module_param(gbuffers, int, 0444); | 111 | module_param(gbuffers, int, 0444); |
115 | module_param(gbufsize, int, 0444); | 112 | module_param(gbufsize, int, 0444); |
116 | module_param(reset_crop, int, 0444); | 113 | module_param(reset_crop, int, 0444); |
@@ -130,7 +127,10 @@ module_param(uv_ratio, int, 0444); | |||
130 | module_param(full_luma_range, int, 0444); | 127 | module_param(full_luma_range, int, 0444); |
131 | module_param(coring, int, 0444); | 128 | module_param(coring, int, 0444); |
132 | 129 | ||
133 | module_param_array(radio, int, NULL, 0444); | 130 | module_param_array(radio, int, NULL, 0444); |
131 | module_param_array(video_nr, int, NULL, 0444); | ||
132 | module_param_array(radio_nr, int, NULL, 0444); | ||
133 | module_param_array(vbi_nr, int, NULL, 0444); | ||
134 | 134 | ||
135 | MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)"); | 135 | MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)"); |
136 | MODULE_PARM_DESC(bigendian,"byte order of the framebuffer, default is native endian"); | 136 | MODULE_PARM_DESC(bigendian,"byte order of the framebuffer, default is native endian"); |
@@ -152,6 +152,9 @@ MODULE_PARM_DESC(irq_iswitch,"switch inputs in irq handler"); | |||
152 | MODULE_PARM_DESC(uv_ratio,"ratio between u and v gains, default is 50"); | 152 | MODULE_PARM_DESC(uv_ratio,"ratio between u and v gains, default is 50"); |
153 | MODULE_PARM_DESC(full_luma_range,"use the full luma range, default is 0 (no)"); | 153 | MODULE_PARM_DESC(full_luma_range,"use the full luma range, default is 0 (no)"); |
154 | MODULE_PARM_DESC(coring,"set the luma coring level, default is 0 (no)"); | 154 | MODULE_PARM_DESC(coring,"set the luma coring level, default is 0 (no)"); |
155 | MODULE_PARM_DESC(video_nr, "video device numbers"); | ||
156 | MODULE_PARM_DESC(vbi_nr, "vbi device numbers"); | ||
157 | MODULE_PARM_DESC(radio_nr, "radio device numbers"); | ||
155 | 158 | ||
156 | MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards"); | 159 | MODULE_DESCRIPTION("bttv - v4l/v4l2 driver module for bt848/878 based cards"); |
157 | MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr"); | 160 | MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr"); |
@@ -4252,7 +4255,8 @@ static int __devinit bttv_register_video(struct bttv *btv) | |||
4252 | 4255 | ||
4253 | if (NULL == btv->video_dev) | 4256 | if (NULL == btv->video_dev) |
4254 | goto err; | 4257 | goto err; |
4255 | if (video_register_device(btv->video_dev,VFL_TYPE_GRABBER,video_nr)<0) | 4258 | if (video_register_device(btv->video_dev, VFL_TYPE_GRABBER, |
4259 | video_nr[btv->c.nr]) < 0) | ||
4256 | goto err; | 4260 | goto err; |
4257 | printk(KERN_INFO "bttv%d: registered device video%d\n", | 4261 | printk(KERN_INFO "bttv%d: registered device video%d\n", |
4258 | btv->c.nr,btv->video_dev->minor & 0x1f); | 4262 | btv->c.nr,btv->video_dev->minor & 0x1f); |
@@ -4268,7 +4272,8 @@ static int __devinit bttv_register_video(struct bttv *btv) | |||
4268 | 4272 | ||
4269 | if (NULL == btv->vbi_dev) | 4273 | if (NULL == btv->vbi_dev) |
4270 | goto err; | 4274 | goto err; |
4271 | if (video_register_device(btv->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) | 4275 | if (video_register_device(btv->vbi_dev, VFL_TYPE_VBI, |
4276 | vbi_nr[btv->c.nr]) < 0) | ||
4272 | goto err; | 4277 | goto err; |
4273 | printk(KERN_INFO "bttv%d: registered device vbi%d\n", | 4278 | printk(KERN_INFO "bttv%d: registered device vbi%d\n", |
4274 | btv->c.nr,btv->vbi_dev->minor & 0x1f); | 4279 | btv->c.nr,btv->vbi_dev->minor & 0x1f); |
@@ -4279,7 +4284,8 @@ static int __devinit bttv_register_video(struct bttv *btv) | |||
4279 | btv->radio_dev = vdev_init(btv, &radio_template, "radio"); | 4284 | btv->radio_dev = vdev_init(btv, &radio_template, "radio"); |
4280 | if (NULL == btv->radio_dev) | 4285 | if (NULL == btv->radio_dev) |
4281 | goto err; | 4286 | goto err; |
4282 | if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO,radio_nr)<0) | 4287 | if (video_register_device(btv->radio_dev, VFL_TYPE_RADIO, |
4288 | radio_nr[btv->c.nr]) < 0) | ||
4283 | goto err; | 4289 | goto err; |
4284 | printk(KERN_INFO "bttv%d: registered device radio%d\n", | 4290 | printk(KERN_INFO "bttv%d: registered device radio%d\n", |
4285 | btv->c.nr,btv->radio_dev->minor & 0x1f); | 4291 | btv->c.nr,btv->radio_dev->minor & 0x1f); |