Skip to content

Commit

Permalink
[SCSI] Remove no-op implementations of SCSI EH hooks
Browse files Browse the repository at this point in the history
Drivers need not implement a hook that returns FAILED, and does nothing
else, since the SCSI midlayer code will do that for us.

Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
jgarzik committed Jun 17, 2005
1 parent e3df715 commit 3471c28
Show file tree
Hide file tree
Showing 40 changed files with 0 additions and 261 deletions.
12 changes: 0 additions & 12 deletions drivers/scsi/53c700.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ MODULE_LICENSE("GPL");
STATIC int NCR_700_queuecommand(struct scsi_cmnd *, void (*done)(struct scsi_cmnd *));
STATIC int NCR_700_abort(struct scsi_cmnd * SCpnt);
STATIC int NCR_700_bus_reset(struct scsi_cmnd * SCpnt);
STATIC int NCR_700_dev_reset(struct scsi_cmnd * SCpnt);
STATIC int NCR_700_host_reset(struct scsi_cmnd * SCpnt);
STATIC void NCR_700_chip_setup(struct Scsi_Host *host);
STATIC void NCR_700_chip_reset(struct Scsi_Host *host);
Expand Down Expand Up @@ -330,7 +329,6 @@ NCR_700_detect(struct scsi_host_template *tpnt,
/* Fill in the missing routines from the host template */
tpnt->queuecommand = NCR_700_queuecommand;
tpnt->eh_abort_handler = NCR_700_abort;
tpnt->eh_device_reset_handler = NCR_700_dev_reset;
tpnt->eh_bus_reset_handler = NCR_700_bus_reset;
tpnt->eh_host_reset_handler = NCR_700_host_reset;
tpnt->can_queue = NCR_700_COMMAND_SLOTS_PER_HOST;
Expand Down Expand Up @@ -1979,16 +1977,6 @@ NCR_700_bus_reset(struct scsi_cmnd * SCp)
return SUCCESS;
}

STATIC int
NCR_700_dev_reset(struct scsi_cmnd * SCp)
{
printk(KERN_INFO "scsi%d (%d:%d) New error handler wants device reset\n\t",
SCp->device->host->host_no, SCp->device->id, SCp->device->lun);
scsi_print_command(SCp);

return FAILED;
}

STATIC int
NCR_700_host_reset(struct scsi_cmnd * SCp)
{
Expand Down
28 changes: 0 additions & 28 deletions drivers/scsi/NCR5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,31 +2833,3 @@ static int NCR5380_bus_reset(Scsi_Cmnd * cmd) {
do_reset(cmd->device->host);
return SUCCESS;
}

/*
* Function : int NCR5380_device_reset (Scsi_Cmnd *cmd)
*
* Purpose : reset a SCSI device
*
* Returns : FAILED
*
* Locks: io_request_lock held by caller
*/

static int NCR5380_device_reset(Scsi_Cmnd * cmd) {
return FAILED;
}

/*
* Function : int NCR5380_host_reset (Scsi_Cmnd *cmd)
*
* Purpose : reset a SCSI device
*
* Returns : FAILED
*
* Locks: io_request_lock held by caller
*/

static int NCR5380_host_reset(Scsi_Cmnd * cmd) {
return FAILED;
}
2 changes: 0 additions & 2 deletions drivers/scsi/NCR5380.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ static void NCR5380_print(struct Scsi_Host *instance);
#endif
static int NCR5380_abort(Scsi_Cmnd * cmd);
static int NCR5380_bus_reset(Scsi_Cmnd * cmd);
static int NCR5380_host_reset(Scsi_Cmnd * cmd);
static int NCR5380_device_reset(Scsi_Cmnd * cmd);
static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
static int NCR5380_proc_info(struct Scsi_Host *instance, char *buffer, char **start,
off_t offset, int length, int inout);
Expand Down
19 changes: 0 additions & 19 deletions drivers/scsi/NCR53c406a.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,6 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
return 0;
}

static int NCR53c406a_abort(Scsi_Cmnd * SCpnt)
{
DEB(printk("NCR53c406a_abort called\n"));
return FAILED; /* Don't know how to abort */
}

static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
{
DEB(printk("NCR53c406a_reset called\n"));
Expand All @@ -741,16 +735,6 @@ static int NCR53c406a_host_reset(Scsi_Cmnd * SCpnt)
return SUCCESS;
}

static int NCR53c406a_device_reset(Scsi_Cmnd * SCpnt)
{
return FAILED;
}

static int NCR53c406a_bus_reset(Scsi_Cmnd * SCpnt)
{
return FAILED;
}

static int NCR53c406a_biosparm(struct scsi_device *disk,
struct block_device *dev,
sector_t capacity, int *info_array)
Expand Down Expand Up @@ -1075,9 +1059,6 @@ static Scsi_Host_Template driver_template =
.release = NCR53c406a_release,
.info = NCR53c406a_info /* info */,
.queuecommand = NCR53c406a_queue /* queuecommand */,
.eh_abort_handler = NCR53c406a_abort /* abort */,
.eh_bus_reset_handler = NCR53c406a_bus_reset /* reset */,
.eh_device_reset_handler = NCR53c406a_device_reset /* reset */,
.eh_host_reset_handler = NCR53c406a_host_reset /* reset */,
.bios_param = NCR53c406a_biosparm /* biosparm */,
.can_queue = 1 /* can_queue */,
Expand Down
9 changes: 0 additions & 9 deletions drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,6 @@ static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg)
return aac_do_ioctl(dev, cmd, arg);
}

/*
* XXX: does aac really need no error handling??
*/
static int aac_eh_abort(struct scsi_cmnd *cmd)
{
return FAILED;
}

/*
* aac_eh_reset - Reset command handling
* @scsi_cmd: SCSI command block causing the reset
Expand Down Expand Up @@ -683,7 +675,6 @@ static struct scsi_host_template aac_driver_template = {
.bios_param = aac_biosparm,
.shost_attrs = aac_attrs,
.slave_configure = aac_slave_configure,
.eh_abort_handler = aac_eh_abort,
.eh_host_reset_handler = aac_eh_reset,
.can_queue = AAC_NUM_IO_FIB,
.this_id = 16,
Expand Down
15 changes: 0 additions & 15 deletions drivers/scsi/aha1542.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,20 +1348,6 @@ static int aha1542_restart(struct Scsi_Host *shost)
return 0;
}

static int aha1542_abort(Scsi_Cmnd * SCpnt)
{

/*
* The abort command does not leave the device in a clean state where
* it is available to be used again. Until this gets worked out, we
* will leave it commented out.
*/

printk(KERN_ERR "aha1542.c: Unable to abort command for target %d\n",
SCpnt->device->id);
return FAILED;
}

/*
* This is a device reset. This is handled by sending a special command
* to the device.
Expand Down Expand Up @@ -1817,7 +1803,6 @@ static Scsi_Host_Template driver_template = {
.detect = aha1542_detect,
.release = aha1542_release,
.queuecommand = aha1542_queuecommand,
.eh_abort_handler = aha1542_abort,
.eh_device_reset_handler= aha1542_dev_reset,
.eh_bus_reset_handler = aha1542_bus_reset,
.eh_host_reset_handler = aha1542_host_reset,
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/aha1542.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ struct ccb { /* Command Control Block 5.3 */

static int aha1542_detect(Scsi_Host_Template *);
static int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int aha1542_abort(Scsi_Cmnd * SCpnt);
static int aha1542_bus_reset(Scsi_Cmnd * SCpnt);
static int aha1542_dev_reset(Scsi_Cmnd * SCpnt);
static int aha1542_host_reset(Scsi_Cmnd * SCpnt);
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/arm/cumana_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ static Scsi_Host_Template cumanascsi_template = {
.info = cumanascsi_info,
.queuecommand = cumanascsi_queue_command,
.eh_abort_handler = NCR5380_abort,
.eh_device_reset_handler= NCR5380_device_reset,
.eh_bus_reset_handler = NCR5380_bus_reset,
.eh_host_reset_handler = NCR5380_host_reset,
.can_queue = 16,
.this_id = 7,
.sg_tablesize = SG_ALL,
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/arm/ecoscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ static Scsi_Host_Template ecoscsi_template = {
.info = ecoscsi_info,
.queuecommand = ecoscsi_queue_command,
.eh_abort_handler = NCR5380_abort,
.eh_device_reset_handler= NCR5380_device_reset,
.eh_bus_reset_handler = NCR5380_bus_reset,
.eh_host_reset_handler = NCR5380_host_reset,
.can_queue = 16,
.this_id = 7,
.sg_tablesize = SG_ALL,
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/arm/oak.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ static Scsi_Host_Template oakscsi_template = {
.info = oakscsi_info,
.queuecommand = oakscsi_queue_command,
.eh_abort_handler = NCR5380_abort,
.eh_device_reset_handler= NCR5380_device_reset,
.eh_bus_reset_handler = NCR5380_bus_reset,
.eh_host_reset_handler = NCR5380_host_reset,
.can_queue = 16,
.this_id = 7,
.sg_tablesize = SG_ALL,
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/dmx3191d.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ static struct scsi_host_template dmx3191d_driver_template = {
.queuecommand = NCR5380_queue_command,
.eh_abort_handler = NCR5380_abort,
.eh_bus_reset_handler = NCR5380_bus_reset,
.eh_device_reset_handler= NCR5380_device_reset,
.eh_host_reset_handler = NCR5380_host_reset,
.can_queue = 32,
.this_id = 7,
.sg_tablesize = SG_ALL,
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/dtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,6 @@ static Scsi_Host_Template driver_template = {
.queuecommand = dtc_queue_command,
.eh_abort_handler = dtc_abort,
.eh_bus_reset_handler = dtc_bus_reset,
.eh_device_reset_handler = dtc_device_reset,
.eh_host_reset_handler = dtc_host_reset,
.bios_param = dtc_biosparam,
.can_queue = CAN_QUEUE,
.this_id = 7,
Expand Down
4 changes: 0 additions & 4 deletions drivers/scsi/dtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ static int dtc_biosparam(struct scsi_device *, struct block_device *,
static int dtc_detect(Scsi_Host_Template *);
static int dtc_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int dtc_bus_reset(Scsi_Cmnd *);
static int dtc_device_reset(Scsi_Cmnd *);
static int dtc_host_reset(Scsi_Cmnd *);

#ifndef CMD_PER_LUN
#define CMD_PER_LUN 2
Expand Down Expand Up @@ -86,8 +84,6 @@ static int dtc_host_reset(Scsi_Cmnd *);
#define NCR5380_queue_command dtc_queue_command
#define NCR5380_abort dtc_abort
#define NCR5380_bus_reset dtc_bus_reset
#define NCR5380_device_reset dtc_device_reset
#define NCR5380_host_reset dtc_host_reset
#define NCR5380_proc_info dtc_proc_info

/* 15 12 11 10
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/eata.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,6 @@ static struct scsi_host_template driver_template = {
.release = eata2x_release,
.queuecommand = eata2x_queuecommand,
.eh_abort_handler = eata2x_eh_abort,
.eh_device_reset_handler = NULL,
.eh_bus_reset_handler = NULL,
.eh_host_reset_handler = eata2x_eh_host_reset,
.bios_param = eata2x_bios_param,
.slave_configure = eata2x_slave_configure,
Expand Down
1 change: 0 additions & 1 deletion drivers/scsi/fcal.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ static Scsi_Host_Template driver_template = {
.use_clustering = ENABLE_CLUSTERING,
.eh_abort_handler = fcp_scsi_abort,
.eh_device_reset_handler = fcp_scsi_dev_reset,
.eh_bus_reset_handler = fcp_scsi_bus_reset,
.eh_host_reset_handler = fcp_scsi_host_reset,
};
#include "scsi_module.c"
Expand Down
12 changes: 0 additions & 12 deletions drivers/scsi/fd_mcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,16 +1241,6 @@ static int fd_mcs_abort(Scsi_Cmnd * SCpnt)
return SUCCESS;
}

static int fd_mcs_host_reset(Scsi_Cmnd * SCpnt)
{
return FAILED;
}

static int fd_mcs_device_reset(Scsi_Cmnd * SCpnt)
{
return FAILED;
}

static int fd_mcs_bus_reset(Scsi_Cmnd * SCpnt) {
struct Scsi_Host *shpnt = SCpnt->device->host;

Expand Down Expand Up @@ -1357,8 +1347,6 @@ static Scsi_Host_Template driver_template = {
.queuecommand = fd_mcs_queue,
.eh_abort_handler = fd_mcs_abort,
.eh_bus_reset_handler = fd_mcs_bus_reset,
.eh_host_reset_handler = fd_mcs_host_reset,
.eh_device_reset_handler = fd_mcs_device_reset,
.bios_param = fd_mcs_biosparam,
.can_queue = 1,
.this_id = 7,
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/g_NCR5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,6 @@ static Scsi_Host_Template driver_template = {
.queuecommand = generic_NCR5380_queue_command,
.eh_abort_handler = generic_NCR5380_abort,
.eh_bus_reset_handler = generic_NCR5380_bus_reset,
.eh_device_reset_handler = generic_NCR5380_device_reset,
.eh_host_reset_handler = generic_NCR5380_host_reset,
.bios_param = NCR5380_BIOSPARAM,
.can_queue = CAN_QUEUE,
.this_id = 7,
Expand Down
4 changes: 0 additions & 4 deletions drivers/scsi/g_NCR5380.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ static int generic_NCR5380_detect(Scsi_Host_Template *);
static int generic_NCR5380_release_resources(struct Scsi_Host *);
static int generic_NCR5380_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int generic_NCR5380_bus_reset(Scsi_Cmnd *);
static int generic_NCR5380_host_reset(Scsi_Cmnd *);
static int generic_NCR5380_device_reset(Scsi_Cmnd *);
static const char* generic_NCR5380_info(struct Scsi_Host *);

#ifndef CMD_PER_LUN
Expand Down Expand Up @@ -114,8 +112,6 @@ static const char* generic_NCR5380_info(struct Scsi_Host *);
#define NCR5380_queue_command generic_NCR5380_queue_command
#define NCR5380_abort generic_NCR5380_abort
#define NCR5380_bus_reset generic_NCR5380_bus_reset
#define NCR5380_device_reset generic_NCR5380_device_reset
#define NCR5380_host_reset generic_NCR5380_host_reset
#define NCR5380_pread generic_NCR5380_pread
#define NCR5380_pwrite generic_NCR5380_pwrite
#define NCR5380_proc_info notyet_generic_proc_info
Expand Down
23 changes: 0 additions & 23 deletions drivers/scsi/gdth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4703,19 +4703,6 @@ static const char *gdth_info(struct Scsi_Host *shp)
return ((const char *)ha->binfo.type_string);
}

/* new error handling */
static int gdth_eh_abort(Scsi_Cmnd *scp)
{
TRACE2(("gdth_eh_abort()\n"));
return FAILED;
}

static int gdth_eh_device_reset(Scsi_Cmnd *scp)
{
TRACE2(("gdth_eh_device_reset()\n"));
return FAILED;
}

static int gdth_eh_bus_reset(Scsi_Cmnd *scp)
{
int i, hanum;
Expand Down Expand Up @@ -4770,13 +4757,6 @@ static int gdth_eh_bus_reset(Scsi_Cmnd *scp)
return SUCCESS;
}

static int gdth_eh_host_reset(Scsi_Cmnd *scp)
{
TRACE2(("gdth_eh_host_reset()\n"));
return FAILED;
}


#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
static int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip)
#else
Expand Down Expand Up @@ -5713,10 +5693,7 @@ static Scsi_Host_Template driver_template = {
.release = gdth_release,
.info = gdth_info,
.queuecommand = gdth_queuecommand,
.eh_abort_handler = gdth_eh_abort,
.eh_device_reset_handler = gdth_eh_device_reset,
.eh_bus_reset_handler = gdth_eh_bus_reset,
.eh_host_reset_handler = gdth_eh_host_reset,
.bios_param = gdth_bios_param,
.can_queue = GDTH_MAXCMDS,
.this_id = -1,
Expand Down
13 changes: 0 additions & 13 deletions drivers/scsi/in2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1671,17 +1671,6 @@ static int in2000_bus_reset(Scsi_Cmnd * cmd)
return SUCCESS;
}

static int in2000_host_reset(Scsi_Cmnd * cmd)
{
return FAILED;
}

static int in2000_device_reset(Scsi_Cmnd * cmd)
{
return FAILED;
}


static int in2000_abort(Scsi_Cmnd * cmd)
{
struct Scsi_Host *instance;
Expand Down Expand Up @@ -2311,8 +2300,6 @@ static Scsi_Host_Template driver_template = {
.queuecommand = in2000_queuecommand,
.eh_abort_handler = in2000_abort,
.eh_bus_reset_handler = in2000_bus_reset,
.eh_device_reset_handler = in2000_device_reset,
.eh_host_reset_handler = in2000_host_reset,
.bios_param = in2000_biosparam,
.can_queue = IN2000_CAN_Q,
.this_id = IN2000_HOST_ID,
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/in2000.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,7 @@ static int in2000_abort(Scsi_Cmnd *);
static void in2000_setup(char *, int *) in2000__INIT;
static int in2000_biosparam(struct scsi_device *, struct block_device *,
sector_t, int *);
static int in2000_host_reset(Scsi_Cmnd *);
static int in2000_bus_reset(Scsi_Cmnd *);
static int in2000_device_reset(Scsi_Cmnd *);


#define IN2000_CAN_Q 16
Expand Down
Loading

0 comments on commit 3471c28

Please sign in to comment.