2.5.73 synclinkmp.c

2.5.73 synclinkmp.c

Post by Paul Fulghu » Fri, 04 Jul 2003 15:10:17



Fix arbitration between net open and tty open.

Clean up unused locals resulting from latest tty changes.

Please apply.

--

Microgate Corporation, http://www.microgate.com

--- linux-2.5.72/drivers/char/synclinkmp.c      2003-06-16 08:42:25.000000000 -0500

 /*
- * $Id: synclinkmp.c,v 4.8 2003/04/21 17:46:55 paulkf Exp $
+ * $Id: synclinkmp.c,v 4.12 2003/06/18 15:29:33 paulkf Exp $
  *
  * Device driver for Microgate SyncLink Multiport

  * assigned major number. May be forced as module parameter.
  */
 static int ttymajor=0;
-static int cuamajor=0;

 /*

 MODULE_PARM(break_on_load,"i");
 MODULE_PARM(ttymajor,"i");
-MODULE_PARM(cuamajor,"i");
 MODULE_PARM(debug_level,"i");
 MODULE_PARM(maxframe,"1-" __MODULE_STRING(MAX_DEVICES) "i");
 MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICES) "i");

 static char *driver_name = "SyncLink MultiPort driver";
-static char *driver_version = "$Revision: 4.8 $";
+static char *driver_version = "$Revision: 4.12 $";

 static int synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);

        info = synclinkmp_device_list;
        while(info && info->line != line)
                info = info->next_device;
-       if ( !info ){
-               printk("%s(%d):%s Can't find specified device on open (line=%d)\n",
-                       __FILE__,__LINE__,info->device_name,line);
+       if (sanity_check(info, tty->name, "open"))
                return -ENODEV;
-       }
-
        if ( info->init_error ) {
                printk("%s(%d):%s device is not allocated, init error=%d\n",

        tty->driver_data = info;
        info->tty = tty;
-       if (sanity_check(info, tty->name, "open"))
-               return -ENODEV;

        if (debug_level >= DEBUG_LEVEL_INFO)

 cleanup:
        if (retval) {
+               if (tty->count == 1)
+                       info->tty = 0; /* tty layer will release tty struct */
                if(info->count)
                        info->count--;

 {
        SLMP_INFO * info = (SLMP_INFO *)tty->driver_data;

-       if (!info || sanity_check(info, tty->name, "close"))
+       if (sanity_check(info, tty->name, "close"))
                return;

        if (debug_level >= DEBUG_LEVEL_INFO)
                printk("%s(%d):%s close() entry, count=%d\n",
                         __FILE__,__LINE__, info->device_name, info->count);

-       if (!info->count || tty_hung_up_p(filp))
+       if (!info->count)
+               return;
+
+       if (tty_hung_up_p(filp))
                goto cleanup;


 static int __init synclinkmp_init(void)
 {
-       SLMP_INFO *info;
-
        if (break_on_load) {
                synclinkmp_get_text_ptr();
                BREAKPOINT();

--

Microgate Corporation, http://www.microgate.com
--

Microgate Corporation, http://www.microgate.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/