patch-2.4.4 linux/drivers/char/serial.c

Next file: linux/drivers/char/sh-sci.c
Previous file: linux/drivers/char/scan_keyb.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/drivers/char/serial.c linux/drivers/char/serial.c
@@ -59,8 +59,8 @@
  *
  */
 
-static char *serial_version = "5.05";
-static char *serial_revdate = "2000-12-13";
+static char *serial_version = "5.05a";
+static char *serial_revdate = "2001-03-20";
 
 /*
  * Serial driver configuration section.  Here are the various options:
@@ -3924,11 +3924,6 @@
 	       return;
        }
 
-       if (!(board->flags & SPCI_FL_ISPNP) && pci_enable_device(dev)) {
-	       printk("serial: PCI device enable failed\n");
-	       return;
-       }
-
 	/*
 	 * Run the initialization function, if any
 	 */
@@ -4610,7 +4605,8 @@
 	 * (Should we try to make guesses for multiport serial devices
 	 * later?) 
 	 */
-	if ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL ||
+	if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
+	    ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
 	    (dev->class & 0xff) > 6)
 		return 1;
 
@@ -4639,6 +4635,7 @@
 				     const struct pci_device_id *ent)
 {
 	struct pci_board *board, tmp;
+	int rc;
 
 	for (board = pci_boards; board->vendor; board++) {
 		if (board->vendor != (unsigned short) PCI_ANY_ID &&
@@ -4656,6 +4653,9 @@
 		break;
 	}
 
+	rc = pci_enable_device(dev);
+	if (rc) return rc;
+
 	if (board->vendor == 0 && serial_pci_guess_board(dev, board))
 		return -ENODEV;
 	else if (serial_pci_guess_board(dev, &tmp) == 0) {
@@ -4708,6 +4708,8 @@
 static struct pci_device_id serial_pci_tbl[] __devinitdata = {
        { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
 	 PCI_CLASS_COMMUNICATION_SERIAL << 8, 0xffff00, },
+       { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
+	 PCI_CLASS_COMMUNICATION_MODEM << 8, 0xffff00, },
        { 0, }
 };
 
@@ -5724,6 +5726,10 @@
 		case 9600:
 		default:
 			cflag |= B9600;
+			/*
+			 * Set this to a sane value to prevent a divide error
+			 */
+			baud  = 9600;
 			break;
 	}
 	switch(bits) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)