Update of /cvsroot/alsa/alsa-driver/support/pnp
In directory sc8-pr-cvs1:/tmp/cvs-serv28682
Modified Files:
pnp.c
Log Message:
fixed the double detection of the card.
the lock-up problem of some cs4232 boards should be fixed.
Index: pnp.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/support/pnp/pnp.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- pnp.c 17 Oct 2003 15:45:02 -0000 1.15
+++ pnp.c 31 Oct 2003 15:02:21 -0000 1.16
@@ -89,6 +89,12 @@
pos = n, n = pos->next)
#endif
+#ifdef ISAPNP_ALSA_LOCAL
+extern struct isapnp_card *isapnp_cards;
+#else
+extern struct list_head isapnp_cards;
+#endif
+
struct pnp_driver_instance {
struct pnp_dev * dev;
struct pnp_driver * driver;
@@ -161,20 +167,29 @@
unsigned short subvendor, subdevice;
unsigned int i, res = 0;
const struct pnp_card_device_id *cid;
- struct pnp_card *card;
+ struct isapnp_card *card;
struct pnp_dev *dev;
struct pnp_card_driver_instance *ninst = NULL;
+#ifndef ISAPNP_ALSA_LOCAL
+ struct list_head *p;
+#endif
if (! drv->probe) {
printk(KERN_ERR "pnp: no probe function!\n");
return -EINVAL;
}
- for (cid = drv->id_table; cid->id[0] != '\0'; cid++) {
- if (parse_id(cid->id, &vendor, &device) < 0)
- continue;
- card = NULL;
- while ((card = (struct pnp_card *)isapnp_find_card(vendor, device,
(struct isapnp_card *)card)) != NULL) {
+#ifdef ISAPNP_ALSA_LOCAL
+ for (card = isapnp_cards; card; card = card->next) {
+#else
+ list_for_each(p, &isapnp_cards) {
+ card = pci_bus_b(p);
+#endif
+ for (cid = drv->id_table; cid->id[0] != '\0'; cid++) {
+ if (parse_id(cid->id, &vendor, &device) < 0)
+ continue;
+ if (card->vendor != vendor || card->device != device)
+ continue;
if (ninst == NULL) {
ninst = kmalloc(sizeof(*ninst), GFP_KERNEL);
if (ninst == NULL)
@@ -187,9 +202,9 @@
for (i = 0; i < PNP_MAX_DEVICES && cid->devs[i].id[0] != '\0';
i++) {
if (parse_id(cid->devs[i].id, &subvendor, &subdevice)
< 0)
goto __next_id;
- dev = ninst->devs[i] = (struct pnp_dev
*)isapnp_find_dev((struct isapnp_card *)card, subvendor, subdevice, NULL);
+ dev = ninst->devs[i] = (struct pnp_dev
*)isapnp_find_dev(card, subvendor, subdevice, NULL);
if (dev == NULL)
- goto __next_card;
+ goto __next_id;
}
/* all parsed successfully */
@@ -205,7 +220,7 @@
dev->p.prepare((struct isapnp_dev *)dev);
}
}
- ninst->link.card = card;
+ ninst->link.card = (struct pnp_card *)card;
ninst->link.driver = drv;
ninst->link.driver_data = NULL;
if (drv->probe(&ninst->link, cid) >= 0) {
@@ -213,11 +228,11 @@
ninst = NULL;
res++;
}
- __next_card:
+ break; /* next card */
+
+ __next_id:
;
}
- __next_id:
- ;
}
if (ninst != NULL)
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog