Patch(2.4.2): Fix Timdia/Sunix serial PCI cards

Gunther Mayer (Gunther.Mayer@t-online.de)
Tue, 27 Feb 2001 21:24:04 +0100


This is a multi-part message in MIME format.
--------------2EC01E6A7F5BEEE672C2C9BD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,
this patch fixes subvendor vs. subdevice and
makes my serial PCI card happy again.

Linus, please apply if you like.

Regards, Gunther

--- linux/drivers/char/serial.c-241-orig Sat Feb 3 13:00:53 2001
+++ linux/drivers/char/serial.c Sat Feb 3 13:31:33 2001
@@ -3845,7 +3845,6 @@
offset = board->first_uart_offset;

/* Timedia/SUNIX uses a mixture of BARs and offsets */
- /* Ugh, this is ugly as all hell --- TYT */
if(dev->vendor == PCI_VENDOR_ID_TIMEDIA ) /* 0x1409 */
switch(idx) {
case 0: base_idx=0;
@@ -4175,12 +4174,17 @@
for (i=0; timedia_data[i].num; i++) {
ids = timedia_data[i].ids;
for (j=0; ids[j]; j++) {
- if (pci_get_subvendor(dev) == ids[j]) {
+ if (pci_get_subdevice(dev) == ids[j]) {
board->num_ports = timedia_data[i].num;
+ printk("serial: Timedia/Sunix/Exsys PCI with %d ports (%x:%x)\n",
+ board->num_ports, pci_get_subvendor(dev),
+ pci_get_subdevice(dev));
return 0;
}
}
}
+ printk("serial: ignoring unknown Timedia/Sunix card (%x:%x)\n",
+ pci_get_subvendor(dev),pci_get_subdevice(dev));
return 0;
}
--------------2EC01E6A7F5BEEE672C2C9BD
Content-Type: application/octet-stream;
name="gmdiff-lx241-serial-timedia-fix"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="gmdiff-lx241-serial-timedia-fix"

LS0tIGxpbnV4L2RyaXZlcnMvY2hhci9zZXJpYWwuYy0yNDEtb3JpZwlTYXQgRmViICAzIDEz
OjAwOjUzIDIwMDEKKysrIGxpbnV4L2RyaXZlcnMvY2hhci9zZXJpYWwuYwlTYXQgRmViICAz
IDEzOjMxOjMzIDIwMDEKQEAgLTM4NDUs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ogCXJldHVybiAwOwogfQogCg==
--------------2EC01E6A7F5BEEE672C2C9BD--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/