]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.2.21rc2 2.2.21-rc2
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:24:13 +0000 (15:24 -0500)
committerAlan Cox <alan@lxorguk.ukuu.org.uk>
Fri, 23 Nov 2007 20:24:13 +0000 (15:24 -0500)
o       Fix Xeon crash on boot                          (Dave Jones)
o       Update keyspan maintainer                       (Greg Kroah-Hartmann)
o       Fix visor oops add palm m125 support            (Greg Kroah-Hartmann)
o       Update whiteheat driver to fix SMP locking      (Greg Kroah-Hartmann)
o       Fix head.S asm for cpu type                     (Mikael Pettersson)

MAINTAINERS
Makefile
arch/i386/kernel/head.S
arch/i386/kernel/setup.c
drivers/char/hfmodem/tables.h [deleted file]
drivers/usb/serial/visor.c
drivers/usb/serial/visor.h
drivers/usb/serial/whiteheat.c

index f4bfe8908cf00fddf89938f8cb5648d8342edc29..f53c67127ec726bf37d0a2acb62d015cba69b07f 100644 (file)
@@ -1075,12 +1075,12 @@ L:      linux-usb-devel@lists.sourceforge.net
 S:     Maintained
 
 USB SERIAL KEYSPAN DRIVER
-P:     Hugh Blemings
-M:     hugh@linuxcare.com
+P:     Greg Kroah-Hartman
+M:     greg@kroah.com
 L:     linux-usb-users@lists.sourceforge.net
 L:     linux-usb-devel@lists.sourceforge.net
 S:     Maintained
-W:     http://www.linuxcare.com.au/hugh/keyspan.html
+W:     http://www.kroah.com/linux/
 
 USB SERIAL DRIVER
 P:     Greg Kroah-Hartman
index 6d8d408cbca8f384be11cd2ea4875506ffae1667..e04be4482fb3e6efb37da2c83377b8a0d065a9f8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 21
-EXTRAVERSION = rc1
+EXTRAVERSION = rc2
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
index 0324c41818481b56f51a550f209060f5e1f63012..4656d1c62c13dacce1efdfb18cd1d2b1d9caf9f4 100644 (file)
@@ -160,7 +160,7 @@ checkCPUtype:
  * we don't need to preserve eflags.
  */
 
-       movl $3,X86             # at least 386
+       movb $3,X86             # at least 386
        pushfl                  # push EFLAGS
        popl %eax               # get EFLAGS
        movl %eax,%ecx          # save original EFLAGS
@@ -173,7 +173,7 @@ checkCPUtype:
        andl $0x40000,%eax      # check if AC bit changed
        je is386
 
-       movl $4,X86             # at least 486
+       movb $4,X86             # at least 486
        movl %ecx,%eax
        xorl $0x200000,%eax     # check ID flag
        pushl %eax
index 2f602ae618473749a349bc252153634c949be527..4a95f6ab8b5382de1edfa317a4e6c2e61b77308f 100644 (file)
@@ -1081,7 +1081,7 @@ static void __init init_centaur(struct cpuinfo_x86 *c)
 
 static void __init init_intel(struct cpuinfo_x86 *c)
 {
-       char *p;
+       char *p = NULL;
        unsigned int l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
 
        if (c->cpuid_level > 1) {
diff --git a/drivers/char/hfmodem/tables.h b/drivers/char/hfmodem/tables.h
deleted file mode 100644 (file)
index d976c8e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * This file is automatically generated by ./gentbl, DO NOT EDIT!
-*/
-
-#define SINTABBITS 9
-#define SINTABSIZE  (1<<SINTABBITS)
-
-static short isintab[SINTABSIZE+SINTABSIZE/4] = {
-            0,   402,   804,  1206,  1607,  2009,  2410,  2811,
-         3211,  3611,  4011,  4409,  4807,  5205,  5601,  5997,
-         6392,  6786,  7179,  7571,  7961,  8351,  8739,  9126,
-         9511,  9895, 10278, 10659, 11038, 11416, 11792, 12166,
-        12539, 12909, 13278, 13645, 14009, 14372, 14732, 15090,
-        15446, 15799, 16150, 16499, 16845, 17189, 17530, 17868,
-        18204, 18537, 18867, 19194, 19519, 19840, 20159, 20474,
-        20787, 21096, 21402, 21705, 22004, 22301, 22594, 22883,
-        23169, 23452, 23731, 24006, 24278, 24546, 24811, 25072,
-        25329, 25582, 25831, 26077, 26318, 26556, 26789, 27019,
-        27244, 27466, 27683, 27896, 28105, 28309, 28510, 28706,
-        28897, 29085, 29268, 29446, 29621, 29790, 29955, 30116,
-        30272, 30424, 30571, 30713, 30851, 30984, 31113, 31236,
-        31356, 31470, 31580, 31684, 31785, 31880, 31970, 32056,
-        32137, 32213, 32284, 32350, 32412, 32468, 32520, 32567,
-        32609, 32646, 32678, 32705, 32727, 32744, 32757, 32764,
-        32767, 32764, 32757, 32744, 32727, 32705, 32678, 32646,
-        32609, 32567, 32520, 32468, 32412, 32350, 32284, 32213,
-        32137, 32056, 31970, 31880, 31785, 31684, 31580, 31470,
-        31356, 31236, 31113, 30984, 30851, 30713, 30571, 30424,
-        30272, 30116, 29955, 29790, 29621, 29446, 29268, 29085,
-        28897, 28706, 28510, 28309, 28105, 27896, 27683, 27466,
-        27244, 27019, 26789, 26556, 26318, 26077, 25831, 25582,
-        25329, 25072, 24811, 24546, 24278, 24006, 23731, 23452,
-        23169, 22883, 22594, 22301, 22004, 21705, 21402, 21096,
-        20787, 20474, 20159, 19840, 19519, 19194, 18867, 18537,
-        18204, 17868, 17530, 17189, 16845, 16499, 16150, 15799,
-        15446, 15090, 14732, 14372, 14009, 13645, 13278, 12909,
-        12539, 12166, 11792, 11416, 11038, 10659, 10278,  9895,
-         9511,  9126,  8739,  8351,  7961,  7571,  7179,  6786,
-         6392,  5997,  5601,  5205,  4807,  4409,  4011,  3611,
-         3211,  2811,  2410,  2009,  1607,  1206,   804,   402,
-            0,  -402,  -804, -1206, -1607, -2009, -2410, -2811,
-        -3211, -3611, -4011, -4409, -4807, -5205, -5601, -5997,
-        -6392, -6786, -7179, -7571, -7961, -8351, -8739, -9126,
-        -9511, -9895,-10278,-10659,-11038,-11416,-11792,-12166,
-       -12539,-12909,-13278,-13645,-14009,-14372,-14732,-15090,
-       -15446,-15799,-16150,-16499,-16845,-17189,-17530,-17868,
-       -18204,-18537,-18867,-19194,-19519,-19840,-20159,-20474,
-       -20787,-21096,-21402,-21705,-22004,-22301,-22594,-22883,
-       -23169,-23452,-23731,-24006,-24278,-24546,-24811,-25072,
-       -25329,-25582,-25831,-26077,-26318,-26556,-26789,-27019,
-       -27244,-27466,-27683,-27896,-28105,-28309,-28510,-28706,
-       -28897,-29085,-29268,-29446,-29621,-29790,-29955,-30116,
-       -30272,-30424,-30571,-30713,-30851,-30984,-31113,-31236,
-       -31356,-31470,-31580,-31684,-31785,-31880,-31970,-32056,
-       -32137,-32213,-32284,-32350,-32412,-32468,-32520,-32567,
-       -32609,-32646,-32678,-32705,-32727,-32744,-32757,-32764,
-       -32767,-32764,-32757,-32744,-32727,-32705,-32678,-32646,
-       -32609,-32567,-32520,-32468,-32412,-32350,-32284,-32213,
-       -32137,-32056,-31970,-31880,-31785,-31684,-31580,-31470,
-       -31356,-31236,-31113,-30984,-30851,-30713,-30571,-30424,
-       -30272,-30116,-29955,-29790,-29621,-29446,-29268,-29085,
-       -28897,-28706,-28510,-28309,-28105,-27896,-27683,-27466,
-       -27244,-27019,-26789,-26556,-26318,-26077,-25831,-25582,
-       -25329,-25072,-24811,-24546,-24278,-24006,-23731,-23452,
-       -23169,-22883,-22594,-22301,-22004,-21705,-21402,-21096,
-       -20787,-20474,-20159,-19840,-19519,-19194,-18867,-18537,
-       -18204,-17868,-17530,-17189,-16845,-16499,-16150,-15799,
-       -15446,-15090,-14732,-14372,-14009,-13645,-13278,-12909,
-       -12539,-12166,-11792,-11416,-11038,-10659,-10278, -9895,
-        -9511, -9126, -8739, -8351, -7961, -7571, -7179, -6786,
-        -6392, -5997, -5601, -5205, -4807, -4409, -4011, -3611,
-        -3211, -2811, -2410, -2009, -1607, -1206,  -804,  -402,
-            0,   402,   804,  1206,  1607,  2009,  2410,  2811,
-         3211,  3611,  4011,  4409,  4807,  5205,  5601,  5997,
-         6392,  6786,  7179,  7571,  7961,  8351,  8739,  9126,
-         9511,  9895, 10278, 10659, 11038, 11416, 11792, 12166,
-        12539, 12909, 13278, 13645, 14009, 14372, 14732, 15090,
-        15446, 15799, 16150, 16499, 16845, 17189, 17530, 17868,
-        18204, 18537, 18867, 19194, 19519, 19840, 20159, 20474,
-        20787, 21096, 21402, 21705, 22004, 22301, 22594, 22883,
-        23169, 23452, 23731, 24006, 24278, 24546, 24811, 25072,
-        25329, 25582, 25831, 26077, 26318, 26556, 26789, 27019,
-        27244, 27466, 27683, 27896, 28105, 28309, 28510, 28706,
-        28897, 29085, 29268, 29446, 29621, 29790, 29955, 30116,
-        30272, 30424, 30571, 30713, 30851, 30984, 31113, 31236,
-        31356, 31470, 31580, 31684, 31785, 31880, 31970, 32056,
-        32137, 32213, 32284, 32350, 32412, 32468, 32520, 32567,
-        32609, 32646, 32678, 32705, 32727, 32744, 32757, 32764
-};
-
index c70cff8029449598ae57743572b19ddc5add2b83..3019c5dbf19fb7772368c5f5e476305664d0c17a 100644 (file)
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  * 
+ * (11/11/2001) gkh
+ *     Added support for the m125 devices, and added check to prevent oopses
+ *     for Clié devices that lie about the number of ports they have.
+ *
  * (08/30/2001) gkh
  *     Added support for the Clie devices, both the 3.5 and 4.0 os versions.
  *     Many thanks to Daniel Burke, and Bryan Payne for helping with this.
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.4"
+#define DRIVER_VERSION "v1.5"
 #define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>"
-#define DRIVER_DESC "USB HandSpring Visor, Palm m50x, Sony Clie driver"
+#define DRIVER_DESC "USB HandSpring Visor, Palm m50x, Sony Clié driver"
 
 #define MIN(a,b)                (((a)<(b))?(a):(b))
 
@@ -148,7 +152,7 @@ static void visor_read_bulk_callback        (struct urb *urb);
 /* All of the device info needed for the Handspring Visor */
 static __u16   handspring_vendor_id    = HANDSPRING_VENDOR_ID;
 static __u16   handspring_product_id   = HANDSPRING_VISOR_ID;
-struct usb_serial_device_type handspring_device = {
+static struct usb_serial_device_type handspring_device = {
        name:                   "Handspring Visor",
        idVendor:               &handspring_vendor_id,
        idProduct:              &handspring_product_id,
@@ -178,7 +182,8 @@ struct usb_serial_device_type handspring_device = {
 static __u16   palm_vendor_id  = PALM_VENDOR_ID;
 static __u16   palm_m500_id    = PALM_M500_ID;
 static __u16   palm_m505_id    = PALM_M505_ID;
-struct usb_serial_device_type palm_m500_device = {
+static __u16   palm_m125_id    = PALM_M125_ID;
+static struct usb_serial_device_type palm_m500_device = {
        name:                   "Palm M500",
        idVendor:               &palm_vendor_id,
        idProduct:              &palm_m500_id,
@@ -205,7 +210,7 @@ struct usb_serial_device_type palm_m500_device = {
 };
 
 /* device info for the Palm M505 */
-struct usb_serial_device_type palm_m505_device = {
+static struct usb_serial_device_type palm_m505_device = {
        name:                   "Palm M505",
        idVendor:               &palm_vendor_id,
        idProduct:              &palm_m505_id,
@@ -231,6 +236,33 @@ struct usb_serial_device_type palm_m505_device = {
        read_bulk_callback:     visor_read_bulk_callback,
 };
 
+/* device info for the Palm M125 */
+static struct usb_serial_device_type palm_m125_device = {
+       name:                   "Palm M125",
+       idVendor:               &palm_vendor_id,
+       idProduct:              &palm_m125_id,
+       needs_interrupt_in:     MUST_HAVE_NOT,          /* this device must not have an interrupt in endpoint */
+       needs_bulk_in:          MUST_HAVE,              /* this device must have a bulk in endpoint */
+       needs_bulk_out:         MUST_HAVE,              /* this device must have a bulk out endpoint */
+       num_interrupt_in:       0,
+       num_bulk_in:            2,
+       num_bulk_out:           2,
+       num_ports:              2,
+       open:                   visor_open,
+       close:                  visor_close,
+       throttle:               visor_throttle,
+       unthrottle:             visor_unthrottle,
+       startup:                visor_startup,
+       shutdown:               visor_shutdown,
+       ioctl:                  visor_ioctl,
+       set_termios:            visor_set_termios,
+       write:                  visor_write,
+       write_room:             visor_write_room,
+       chars_in_buffer:        visor_chars_in_buffer,
+       write_bulk_callback:    visor_write_bulk_callback,
+       read_bulk_callback:     visor_read_bulk_callback,
+};
+
 /* device info for the Sony Clie OS version 3.5 */
 static __u16   sony_vendor_id  = SONY_VENDOR_ID;
 static __u16   sony_3_5_id     = SONY_CLIE_3_5_ID;
@@ -307,6 +339,11 @@ static int visor_open (struct usb_serial_port *port, struct file *filp)
        
        dbg(__FUNCTION__ " - port %d", port->number);
 
+       if (!port->read_urb) {
+               err ("Device lied about number of ports, please use a lower one.");
+               return -ENODEV;
+       }
+
        down (&port->sem);
        
        ++port->open_count;
@@ -709,9 +746,8 @@ static void visor_shutdown (struct usb_serial *serial)
 
        /* stop reads and writes on all ports */
        for (i=0; i < serial->num_ports; ++i) {
-               while (serial->port[i].open_count > 0) {
-                       visor_close (&serial->port[i], NULL);
-               }
+               serial->port[i].active = 0;
+               serial->port[i].open_count = 0;
        }
 }
 
@@ -798,6 +834,7 @@ static int __init visor_init (void)
        usb_serial_register (&handspring_device);
        usb_serial_register (&palm_m500_device);
        usb_serial_register (&palm_m505_device);
+       usb_serial_register (&palm_m125_device);
        usb_serial_register (&clie_3_5_device);
        usb_serial_register (&clie_4_0_device);
        
@@ -833,6 +870,7 @@ static void __exit visor_exit (void)
        usb_serial_deregister (&handspring_device);
        usb_serial_deregister (&palm_m500_device);
        usb_serial_deregister (&palm_m505_device);
+       usb_serial_deregister (&palm_m125_device);
        usb_serial_deregister (&clie_3_5_device);
        usb_serial_deregister (&clie_4_0_device);
 
index c96b7823a94674908b7bbf8ff689a1bae84c02b6..17b1605ec12d3295a360933c15f7efe0b8e535e9 100644 (file)
@@ -23,6 +23,7 @@
 #define PALM_VENDOR_ID                 0x0830
 #define PALM_M500_ID                   0x0001
 #define PALM_M505_ID                   0x0002
+#define PALM_M125_ID                   0x0040
 
 #define SONY_VENDOR_ID                 0x054C
 #define SONY_CLIE_3_5_ID               0x0038
index d3d56b5052d330094f52af7b8f1b90d4d3d2e07a..4d1e9d778a5659d00943af1472016f6b161608ff 100644 (file)
@@ -11,6 +11,9 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  *
+ * (05/30/2001) gkh
+ *     switched from using spinlock to a semaphore, which fixes lots of problems.
+ *
  * (04/08/2001) gb
  *     Identify version on module load.
  * 
@@ -82,7 +85,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.0.0"
+#define DRIVER_VERSION "v1.1"
 #define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>"
 #define DRIVER_DESC "USB ConnectTech WhiteHEAT driver"
 
@@ -104,7 +107,7 @@ static void whiteheat_shutdown              (struct usb_serial *serial);
 static __u16   connecttech_vendor_id                   = CONNECT_TECH_VENDOR_ID;
 static __u16   connecttech_whiteheat_fake_product_id   = CONNECT_TECH_FAKE_WHITE_HEAT_ID;
 static __u16   connecttech_whiteheat_product_id        = CONNECT_TECH_WHITE_HEAT_ID;
-struct usb_serial_device_type whiteheat_fake_device = {
+static struct usb_serial_device_type whiteheat_fake_device = {
        name:                   "Connect Tech - WhiteHEAT - (prerenumeration)",
        idVendor:               &connecttech_vendor_id,                 /* the Connect Tech vendor id */
        idProduct:              &connecttech_whiteheat_fake_product_id, /* the White Heat initial product id */
@@ -117,7 +120,7 @@ struct usb_serial_device_type whiteheat_fake_device = {
        num_ports:              1,
        startup:                whiteheat_startup       
 };
-struct usb_serial_device_type whiteheat_device = {
+static struct usb_serial_device_type whiteheat_device = {
        name:                   "Connect Tech - WhiteHEAT",
        idVendor:               &connecttech_vendor_id,                 /* the Connect Tech vendor id */
        idProduct:              &connecttech_whiteheat_product_id,      /* the White Heat real product id */
@@ -228,6 +231,7 @@ static int whiteheat_send_cmd (struct usb_serial *serial, __u8 command, __u8 *da
        struct usb_serial_port *port;
        int timeout;
        __u8 *transfer_buffer;
+       int retval = 0;
 
        dbg(__FUNCTION__" - command %d", command);
 
@@ -240,9 +244,10 @@ static int whiteheat_send_cmd (struct usb_serial *serial, __u8 command, __u8 *da
        memcpy (&transfer_buffer[1], data, datasize);
        port->write_urb->transfer_buffer_length = datasize + 1;
        port->write_urb->dev = serial->dev;
-       if (usb_submit_urb (port->write_urb)) {
+       retval = usb_submit_urb (port->write_urb);
+       if (retval) {
                dbg (__FUNCTION__" - submit urb failed");
-               return -1;
+               goto exit;
        }
 
        /* wait for the command to complete */
@@ -253,20 +258,21 @@ static int whiteheat_send_cmd (struct usb_serial *serial, __u8 command, __u8 *da
 
        if (info->command_finished == FALSE) {
                dbg (__FUNCTION__ " - command timed out.");
-               return -1;
+               retval = -ETIMEDOUT;
+               goto exit;
        }
 
        if (info->command_finished == WHITEHEAT_CMD_FAILURE) {
                dbg (__FUNCTION__ " - command failed.");
-               return -1;
+               retval = -EIO;
+               goto exit;
        }
 
-       if (info->command_finished == WHITEHEAT_CMD_COMPLETE) {
+       if (info->command_finished == WHITEHEAT_CMD_COMPLETE)
                dbg (__FUNCTION__ " - command completed.");
-               return 0;
-       }
 
-       return 0;
+exit:
+       return retval;
 }
 
 
@@ -275,10 +281,12 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
        struct whiteheat_min_set        open_command;
        struct usb_serial_port          *command_port;
        struct whiteheat_private        *info;
-       int                             result;
+       int                             retval = 0;
 
        dbg(__FUNCTION__" - port %d", port->number);
 
+       down (&port->sem);
+
        ++port->open_count;
        MOD_INC_USE_COUNT;
        
@@ -291,7 +299,8 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
                        info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL);
                        if (info == NULL) {
                                err(__FUNCTION__ " - out of memory");
-                               return -ENOMEM;
+                               retval = -ENOMEM;
+                               goto error_exit;
                        }
                        
                        init_waitqueue_head(&info->wait_command);
@@ -300,27 +309,45 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
                        command_port->read_urb->complete = command_port_read_callback;
                        command_port->read_urb->dev = port->serial->dev;
                        command_port->tty = port->tty;          /* need this to "fake" our our sanity check macros */
-                       usb_submit_urb (command_port->read_urb);
+                       retval = usb_submit_urb (command_port->read_urb);
+                       if (retval) {
+                               err(__FUNCTION__ " - failed submitting read urb, error %d", retval);
+                               goto error_exit;
+                       }
                }
                
                /* Start reading from the device */
                port->read_urb->dev = port->serial->dev;
-               result = usb_submit_urb(port->read_urb);
-               if (result)
-                       err(__FUNCTION__ " - failed submitting read urb, error %d", result);
+               retval = usb_submit_urb(port->read_urb);
+               if (retval) {
+                       err(__FUNCTION__ " - failed submitting read urb, error %d", retval);
+                       goto error_exit;
+               }
        
                /* send an open port command */
                /* firmware uses 1 based port numbering */
                open_command.port = port->number - port->serial->minor + 1;
-               whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command));
+               retval = whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command));
+               if (retval)
+                       goto error_exit;
        
                /* Need to do device specific setup here (control lines, baud rate, etc.) */
                /* FIXME!!! */
        }
 
        dbg(__FUNCTION__ " - exit");
+       up (&port->sem);
        
-       return 0;
+       return retval;
+
+error_exit:
+       --port->open_count;
+       MOD_DEC_USE_COUNT;
+
+       dbg(__FUNCTION__ " - error_exit");
+       up (&port->sem);
+       
+       return retval;
 }
 
 
@@ -330,6 +357,7 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
        
        dbg(__FUNCTION__ " - port %d", port->number);
        
+       down (&port->sem);
        --port->open_count;
 
        if (port->open_count <= 0) {
@@ -347,6 +375,7 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
                port->active = 0;
        }
        MOD_DEC_USE_COUNT;
+       up (&port->sem);
 }
 
 
@@ -360,25 +389,28 @@ static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, un
 
 static void whiteheat_set_termios (struct usb_serial_port *port, struct termios *old_termios)
 {
-       unsigned int cflag = port->tty->termios->c_cflag;
+       unsigned int cflag;
        struct whiteheat_port_settings port_settings;
 
        dbg(__FUNCTION__ " -port %d", port->number);
 
+       down (&port->sem);
+
+       if ((!port->tty) || (!port->tty->termios)) {
+               dbg(__FUNCTION__" - no tty structures");
+               goto exit;
+       }
+       
+       cflag = port->tty->termios->c_cflag;
        /* check that they really want us to change something */
        if (old_termios) {
                if ((cflag == old_termios->c_cflag) &&
                    (RELEVANT_IFLAG(port->tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) {
                        dbg(__FUNCTION__ " - nothing to change...");
-                       return;
+                       goto exit;
                }
        }
 
-       if ((!port->tty) || (!port->tty->termios)) {
-               dbg(__FUNCTION__" - no tty structures");
-               return;
-       }
-       
        /* set the port number */
        /* firmware uses 1 based port numbering */
        port_settings.port = port->number + 1;
@@ -443,6 +475,8 @@ static void whiteheat_set_termios (struct usb_serial_port *port, struct termios
        /* now send the message to the device */
        whiteheat_send_cmd (port->serial, WHITEHEAT_SETUP_PORT, (__u8 *)&port_settings, sizeof(port_settings));
        
+exit:
+       up (&port->sem);
        return;
 }