Commit 1dd040ff authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] fdomain screwup

| From: Andrew Morton
| To: linux-scsi@vger.kernel.org
| Subject: fdomain screwup
|
| - fdomain_setup() is marked __init, but is called from non-__init
|   fdomain_16x0_detect()
|
| - fdomain_setup() is declared in drivers/scsi/pcmcia/fdomain_stub.c as
|   taking two arguments, but is implemented in fdomain_setup() taking a
|   single argument.
|
|   Please, never ever ever put extern function declarations in .c files.
|   Put it in a header file which is visible to the definition and to all
|   callsites.
|
| - fdomain_setup() is declared static, hence the linkage fails.
|
| - fdomain_16x0_bus_reset() is implemented in drivers/scsi/fdomain.c but
|   has static scope, so the call from drivers/scsi/pcmcia/fdomain_stub.c
|   doesn't work.

[I didn't find this to be the case, so I didn't fix it.]

| - fdomain_16x0_bus_reset() has an extern declaration in
|   drivers/scsi/pcmcia/fdomain_stub.c.  This should be moved to a header
|   file which is visible to etc...

Builds and loads.  No hardware to test.
Signed-off-by: default avatarRandy Dunlap <rddunlap@osdl.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent f092d184
...@@ -285,6 +285,7 @@ ...@@ -285,6 +285,7 @@
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include "fdomain.h"
MODULE_AUTHOR("Rickard E. Faith"); MODULE_AUTHOR("Rickard E. Faith");
MODULE_DESCRIPTION("Future domain SCSI driver"); MODULE_DESCRIPTION("Future domain SCSI driver");
...@@ -551,7 +552,7 @@ static void print_banner( struct Scsi_Host *shpnt ) ...@@ -551,7 +552,7 @@ static void print_banner( struct Scsi_Host *shpnt )
printk( "\n" ); printk( "\n" );
} }
int __init fdomain_setup(char *str) int fdomain_setup(char *str)
{ {
int ints[4]; int ints[4];
...@@ -901,7 +902,7 @@ struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt ) ...@@ -901,7 +902,7 @@ struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt )
Write_FIFO_port = port_base + Write_FIFO; Write_FIFO_port = port_base + Write_FIFO;
Write_SCSI_Data_port = port_base + Write_SCSI_Data; Write_SCSI_Data_port = port_base + Write_SCSI_Data;
fdomain_16x0_bus_reset( NULL); fdomain_16x0_bus_reset(NULL);
if (fdomain_test_loopback()) { if (fdomain_test_loopback()) {
printk(KERN_ERR "scsi: <fdomain> Detection failed (loopback test failed at port base 0x%x)\n", port_base); printk(KERN_ERR "scsi: <fdomain> Detection failed (loopback test failed at port base 0x%x)\n", port_base);
......
/*
* fdomain.c -- Future Domain TMC-16x0 SCSI driver
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992-1996, 1998 Rickard E. Faith (faith@acm.org)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
extern Scsi_Host_Template fdomain_driver_template;
extern int fdomain_setup(char *str);
extern struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt );
extern int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include "fdomain.h"
#include <pcmcia/version.h> #include <pcmcia/version.h>
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
...@@ -84,10 +85,6 @@ typedef struct scsi_info_t { ...@@ -84,10 +85,6 @@ typedef struct scsi_info_t {
struct Scsi_Host *host; struct Scsi_Host *host;
} scsi_info_t; } scsi_info_t;
extern Scsi_Host_Template fdomain_driver_template;
extern void fdomain_setup(char *str, int *ints);
extern struct Scsi_Host *__fdomain_16x0_detect( Scsi_Host_Template *tpnt );
extern int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt);
static void fdomain_release(dev_link_t *link); static void fdomain_release(dev_link_t *link);
static int fdomain_event(event_t event, int priority, static int fdomain_event(event_t event, int priority,
...@@ -189,7 +186,7 @@ static void fdomain_config(dev_link_t *link) ...@@ -189,7 +186,7 @@ static void fdomain_config(dev_link_t *link)
scsi_info_t *info = link->priv; scsi_info_t *info = link->priv;
tuple_t tuple; tuple_t tuple;
cisparse_t parse; cisparse_t parse;
int i, last_ret, last_fn, ints[3]; int i, last_ret, last_fn;
u_char tuple_data[64]; u_char tuple_data[64];
char str[16]; char str[16];
struct Scsi_Host *host; struct Scsi_Host *host;
...@@ -229,11 +226,8 @@ static void fdomain_config(dev_link_t *link) ...@@ -229,11 +226,8 @@ static void fdomain_config(dev_link_t *link)
release_region(link->io.BasePort1, link->io.NumPorts1); release_region(link->io.BasePort1, link->io.NumPorts1);
/* Set configuration options for the fdomain driver */ /* Set configuration options for the fdomain driver */
ints[0] = 2;
ints[1] = link->io.BasePort1;
ints[2] = link->irq.AssignedIRQ;
sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ); sprintf(str, "%d,%d", link->io.BasePort1, link->irq.AssignedIRQ);
fdomain_setup(str, ints); fdomain_setup(str);
host = __fdomain_16x0_detect(&fdomain_driver_template); host = __fdomain_16x0_detect(&fdomain_driver_template);
if (!host) { if (!host) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment