mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] synclinkmp.c 2.4.23-pre3
@ 2003-09-04 14:29 Paul Fulghum
  2003-09-04 14:43 ` John Levon
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Fulghum @ 2003-09-04 14:29 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-kernel

* fix arbitration between net open and tty open
* add MODULE_LICENSE() macro
* use time_after() macro

Please apply

-- 
Paul Fulghum, paulkf@microgate.com
Microgate Corporation, http://www.microgate.com

--- linux-2.4.23-pre3/drivers/char/synclinkmp.c	2002-11-28 17:53:12.000000000 -0600
+++ linux-2.4.23-pre3-mg/drivers/char/synclinkmp.c	2003-06-19 08:27:19.000000000 -0500
@@ -1,5 +1,5 @@
 /*
- * $Id: synclinkmp.c,v 3.17 2002/04/22 16:05:39 paulkf Exp $
+ * $Id: synclinkmp.c,v 3.21 2003/06/18 21:02:26 paulkf Exp $
  *
  * Device driver for Microgate SyncLink Multiport
  * high speed multiprotocol serial adapter.
@@ -504,7 +504,7 @@
 MODULE_PARM(dosyncppp,"1-" __MODULE_STRING(MAX_DEVICES) "i");
 
 static char *driver_name = "SyncLink MultiPort driver";
-static char *driver_version = "$Revision: 3.17 $";
+static char *driver_version = "$Revision: 3.21 $";
 
 static int __devinit synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);
 static void __devexit synclinkmp_remove_one(struct pci_dev *dev);
@@ -515,6 +515,10 @@
 };
 MODULE_DEVICE_TABLE(pci, synclinkmp_pci_tbl);
 
+#ifdef MODULE_LICENSE
+MODULE_LICENSE("GPL");
+#endif
+
 static struct pci_driver synclinkmp_pci_driver = {
 	name:		"synclinkmp",
 	id_table:	synclinkmp_pci_tbl,
@@ -748,12 +752,8 @@
 	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->device, "open"))
 		return -ENODEV;
-	}
-
 	if ( info->init_error ) {
 		printk("%s(%d):%s device is not allocated, init error=%d\n",
 			__FILE__,__LINE__,info->device_name,info->init_error);
@@ -762,8 +762,6 @@
 
 	tty->driver_data = info;
 	info->tty = tty;
-	if (sanity_check(info, tty->device, "open"))
-		return -ENODEV;
 
 	if (debug_level >= DEBUG_LEVEL_INFO)
 		printk("%s(%d):%s open(), old ref count = %d\n",
@@ -825,6 +823,8 @@
 
 cleanup:
 	if (retval) {
+		if (tty->count == 1)
+			info->tty = 0; /* tty layer will release tty struct */
 		if(MOD_IN_USE)
 			MOD_DEC_USE_COUNT;
 		if(info->count)
@@ -841,14 +841,17 @@
 {
 	SLMP_INFO * info = (SLMP_INFO *)tty->driver_data;
 
-	if (!info || sanity_check(info, tty->device, "close"))
+	if (sanity_check(info, tty->device, "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;
 
 	if ((tty->count == 1) && (info->count != 1)) {
@@ -1203,7 +1206,7 @@
 			schedule_timeout(char_time);
 			if (signal_pending(current))
 				break;
-			if (timeout && ((orig_jiffies + timeout) < jiffies))
+			if (timeout && time_after(jiffies, orig_jiffies + timeout))
 				break;
 		}
 	} else {
@@ -1214,7 +1217,7 @@
 			schedule_timeout(char_time);
 			if (signal_pending(current))
 				break;
-			if (timeout && ((orig_jiffies + timeout) < jiffies))
+			if (timeout && time_after(jiffies, orig_jiffies + timeout))
 				break;
 		}
 	}




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] synclinkmp.c 2.4.23-pre3
  2003-09-04 14:29 [PATCH] synclinkmp.c 2.4.23-pre3 Paul Fulghum
@ 2003-09-04 14:43 ` John Levon
  2003-09-04 14:55   ` Paul Fulghum
  0 siblings, 1 reply; 3+ messages in thread
From: John Levon @ 2003-09-04 14:43 UTC (permalink / raw)
  To: Paul Fulghum; +Cc: Marcelo Tosatti, linux-kernel

On Thu, Sep 04, 2003 at 09:29:45AM -0500, Paul Fulghum wrote:

> * add MODULE_LICENSE() macro
> 
> Please apply

Why is it wrapped inside #ifdef MODULE_LICENSE ? It's in current 2.4 and
current 2.6, no ? When would it ever not be defined ?

regards
john

-- 
Khendon's Law:
If the same point is made twice by the same person, the thread is over.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] synclinkmp.c 2.4.23-pre3
  2003-09-04 14:43 ` John Levon
@ 2003-09-04 14:55   ` Paul Fulghum
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Fulghum @ 2003-09-04 14:55 UTC (permalink / raw)
  To: John Levon; +Cc: Marcelo Tosatti, linux-kernel

> Why is it wrapped inside #ifdef MODULE_LICENSE ? It's in current 2.4 and
> current 2.6, no ?

No.
It is not in all 2.4 versions.

I have to support customers for all versions of 2.4.

The ifdef allows me to have a single source file
that works for all versions of 2.4.

Paul Fulghum, paulkf@microgate.com
Microgate Corporation, www.microgate.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-04 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-04 14:29 [PATCH] synclinkmp.c 2.4.23-pre3 Paul Fulghum
2003-09-04 14:43 ` John Levon
2003-09-04 14:55   ` Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome