From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: Fri, 7 Mar 97 10:41:23 +0100
To: linux-m68k@phil.uni-sb.de
Subject: L68K: Bug in Atari SCC driver
X-Yow: I'm wearing PAMPERS!!
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

The Atari SCC serial driver when compiled as a module tries to free the
interrupts for channel A twice when unloading.  Here's a patch.

Andreas.

--- drivers/char/atari_SCC.c.~1~	Mon Feb 17 19:10:33 1997
+++ drivers/char/atari_SCC.c	Thu Mar  6 17:21:26 1997
@@ -1364,10 +1364,11 @@
      *			  If we use only the cha232_line, unloading a 
      *			  module causes a damaged irq list!
      */
-    if (cha232_line>=0)
-      SCC_deinit_port( &rs_table[cha232_line], CHANNEL_A );
-    if (cha422_line >=0)
-	  SCC_deinit_port( &rs_table[cha422_line], CHANNEL_A );
+	/* We must deinit channel A only once! ++Andreas. */
+	if (cha232_line >= 0)
+		SCC_deinit_port(&rs_table[cha232_line], CHANNEL_A);
+	else if (cha422_line >= 0)
+		SCC_deinit_port(&rs_table[cha422_line], CHANNEL_A);
 
 	if (cha232_line >= 0)
 		unregister_serial( cha232_line );
