All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCMCIA bug fix
@ 2004-06-29 15:38 Andrey Ulanov
  2004-06-29 15:48 ` Russell King
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Ulanov @ 2004-06-29 15:38 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 193 bytes --]

I tested with one of ieee1394+usb2.0 PCMCIA adapters. Worked fine.
Without this patch only first device (ieee1394 controller) was
detected.

Please apply.
-- 
with best regards, Andrey Ulanov.

[-- Attachment #2: pcmcia-multi.patch --]
[-- Type: text/plain, Size: 918 bytes --]

--- linux/drivers/pcmcia/cardbus.c.pcmcia	2004-06-29 18:37:27.000000000 +0400
+++ linux/drivers/pcmcia/cardbus.c	2004-06-29 18:39:37.000000000 +0400
@@ -435,12 +435,12 @@
 	pci_readb(&tmp, PCI_HEADER_TYPE, &hdr);
 	fn = 1;
 	if (hdr & 0x80) {
-		do {
-			tmp.devfn = fn;
+		for (i = 0; i < 8; i++) {
+			tmp.devfn = i;
 			if (pci_readw(&tmp, PCI_VENDOR_ID, &v) || !v || v == 0xffff)
-				break;
+				continue;
 			fn++;
-		} while (fn < 8);
+		};
 	}
 	s->functions = fn;
 
@@ -450,11 +450,17 @@
 	memset(c, 0, fn * sizeof(struct cb_config_t));
 
 	irq = s->cap.pci_irq;
-	for (i = 0; i < fn; i++) {
-		struct pci_dev *dev = &c[i].dev;
+	for (i = 0, fn = 0; i < 8; i++) {
+		struct pci_dev *dev = &c[fn].dev;
 		u8 irq_pin;
 		int r;
 
+		tmp.devfn = i;
+		if(pci_readw(&tmp, PCI_VENDOR_ID, &v) || !v || v == 0xffff)
+		    continue;
+
+		fn++;
+
 		dev->bus = bus;
 		dev->sysdata = bus->sysdata;
 		dev->devfn = i;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-30  5:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-29 15:38 [PATCH] PCMCIA bug fix Andrey Ulanov
2004-06-29 15:48 ` Russell King
2004-06-30  5:39   ` Andrey Ulanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.