Skip to contentSkip to conversation

fd_mcs: fix __setup function

PATCH New Randy.Dunlap 1 participant 1 message Aug 4, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fd_mcs: fix __setup function

Use correct __setup function type and parameters.
Return result from __setup function.
Don't confuse <ints> and <interrupts>.

diffstat:=

 drivers/scsi/fd_mcs.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
drivers/scsi/fd_mcs.c renamed from drivers/scsi/fd_mcs.c~fd_mcs_init +7 -3
diff -Naurp ./drivers/scsi/fd_mcs.c~fd_mcs_init ./drivers/scsi/fd_mcs.c
@@ -78,6 +78,7 @@
  **************************************************************************/
 
 #include <linux/module.h>
+#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/blkdev.h>
 #include <linux/errno.h>
@@ -288,7 +289,7 @@ static irqreturn_t fd_mcs_intr(int irq, 
 
 static unsigned long addresses[] = { 0xc8000, 0xca000, 0xce000, 0xde000 };
 static unsigned short ports[] = { 0x140, 0x150, 0x160, 0x170 };
-static unsigned short ints[] = { 3, 5, 10, 11, 12, 14, 15, 0 };
+static unsigned short interrupts[] = { 3, 5, 10, 11, 12, 14, 15, 0 };
 
 /* host information */
 static int found = 0;
@@ -297,16 +298,19 @@ static struct Scsi_Host *hosts[FD_MAX_HO
 static int user_fifo_count = 0;
 static int user_fifo_size = 0;
 
-static void fd_mcs_setup(char *str, int *ints)
+static int __init fd_mcs_setup(char *str)
 {
 	static int done_setup = 0;
+	int ints[3];
 
 	if (done_setup++ || ints[0] < 1 || ints[0] > 2 || ints[1] < 1 || ints[1] > 16) {
 		printk("fd_mcs: usage: fd_mcs=FIFO_COUNT, FIFO_SIZE\n");
+		return 0;
 	}
 
 	user_fifo_count = ints[0] >= 1 ? ints[1] : 0;
 	user_fifo_size = ints[0] >= 2 ? ints[2] : 0;
+	return 1;
 }
 
 __setup("fd_mcs=", fd_mcs_setup);
@@ -391,7 +395,7 @@ static int fd_mcs_detect(Scsi_Host_Templ
 			} else {
 				bios = addresses[pos2 >> 6];
 				port = ports[(pos2 >> 4) & 0x03];
-				irq = ints[(pos2 >> 1) & 0x07];
+				irq = interrupts[(pos2 >> 1) & 0x07];
 			}
 
 			if (irq) {

--