diff options
author | Janne Grunau <janne-dvb@grunau.be> | 2008-04-09 18:13:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:08:00 -0400 |
commit | 78e92006f410a4044f8c1760c25ac9d11d259aa2 (patch) | |
tree | 293de8abe261420df2db5e12936ec2721ea52c7c /drivers/media/dvb/bt8xx | |
parent | 9950c1b5b4b86d4aae12853c2f0a0ef11d976764 (diff) |
V4L/DVB (7538): Adds selectable adapter numbers as per module option
The adapter_nr module options can be used to allocate static adapter
numbers on a driver level. It avoids problems with changing DVB apapter
numbers after warm/cold boot or device unplugging and repluging.
Each driver holds DVB_MAX_ADAPTER long array of the preferred order of
adapter numbers.
options dvb-usb-dib0700 adapter_nr=7,6,5,4,3,2,1,0 would result in a
reversed allocation of adapter numbers.
With adapter_nr=2,5 it tries first to get adapter number 2 and 5. If
both are already in use it will allocate the lowest free adapter number.
Signed-off-by: Janne Grunau <janne-dvb@grunau.be>
Acked-by: Hermann Pitton <hermann.pitton@arcor.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/bt8xx')
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index a39439b5f04c..6afbfbbef0ce 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -40,6 +40,8 @@ static int debug; | |||
40 | module_param(debug, int, 0644); | 40 | module_param(debug, int, 0644); |
41 | MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); | 41 | MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); |
42 | 42 | ||
43 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | ||
44 | |||
43 | #define dprintk( args... ) \ | 45 | #define dprintk( args... ) \ |
44 | do { \ | 46 | do { \ |
45 | if (debug) printk(KERN_DEBUG args); \ | 47 | if (debug) printk(KERN_DEBUG args); \ |
@@ -717,7 +719,10 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
717 | { | 719 | { |
718 | int result; | 720 | int result; |
719 | 721 | ||
720 | if ((result = dvb_register_adapter(&card->dvb_adapter, card->card_name, THIS_MODULE, &card->bt->dev->dev)) < 0) { | 722 | result = dvb_register_adapter(&card->dvb_adapter, card->card_name, |
723 | THIS_MODULE, &card->bt->dev->dev, | ||
724 | adapter_nr); | ||
725 | if (result < 0) { | ||
721 | printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result); | 726 | printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result); |
722 | return result; | 727 | return result; |
723 | } | 728 | } |