public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gunther.Mayer@t-online.de (Gunther Mayer)
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: Patch(2.4.2): Fix Timdia/Sunix serial PCI cards
Date: Tue, 27 Feb 2001 21:24:04 +0100	[thread overview]
Message-ID: <3A9C0CE4.EAE660CE@t-online.de> (raw)

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

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;
 }

[-- Attachment #2: gmdiff-lx241-serial-timedia-fix --]
[-- Type: application/octet-stream, Size: 955 bytes --]

--- 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;
 }
 

                 reply	other threads:[~2001-02-27 19:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A9C0CE4.EAE660CE@t-online.de \
    --to=gunther.mayer@t-online.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox