summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-01-03 06:05:37 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2016-01-07 03:42:59 +0100
commit8d8601a757688386e914b922cc267a9244e0fdc9 (patch)
treef92f9fa36f61508ebbb13bbc7a35841e4a4262d8 /drivers/scsi/NCR5380.c
parentncr5380: Dont wait for BUS FREE after disconnect (diff)
downloadlinux-8d8601a757688386e914b922cc267a9244e0fdc9.tar.xz
linux-8d8601a757688386e914b922cc267a9244e0fdc9.zip
ncr5380: Use work_struct instead of delayed_work
Each host instance now has it's own work queue so the main() work item can sleep when necessary. That means we can use a simple work item rather than a delayed work item. This brings NCR5380.c closer to atari_NCR5380.c. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r--drivers/scsi/NCR5380.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index a64b298eeb55..8ff59509585c 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -697,7 +697,7 @@ static int NCR5380_init(struct Scsi_Host *instance, int flags)
hostdata->issue_queue = NULL;
hostdata->disconnected_queue = NULL;
- INIT_DELAYED_WORK(&hostdata->coroutine, NCR5380_main);
+ INIT_WORK(&hostdata->main_task, NCR5380_main);
hostdata->work_q = alloc_workqueue("ncr5380_%d",
WQ_UNBOUND | WQ_MEM_RECLAIM,
1, instance->host_no);
@@ -797,7 +797,7 @@ static void NCR5380_exit(struct Scsi_Host *instance)
{
struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
- cancel_delayed_work_sync(&hostdata->coroutine);
+ cancel_work_sync(&hostdata->main_task);
destroy_workqueue(hostdata->work_q);
}
@@ -859,9 +859,8 @@ static int NCR5380_queue_command(struct Scsi_Host *instance,
dprintk(NDEBUG_QUEUES, "scsi%d : command added to %s of queue\n", instance->host_no, (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
- /* Run the coroutine if it isn't already running. */
/* Kick off command processing */
- queue_delayed_work(hostdata->work_q, &hostdata->coroutine, 0);
+ queue_work(hostdata->work_q, &hostdata->main_task);
return 0;
}
@@ -880,7 +879,7 @@ static int NCR5380_queue_command(struct Scsi_Host *instance,
static void NCR5380_main(struct work_struct *work)
{
struct NCR5380_hostdata *hostdata =
- container_of(work, struct NCR5380_hostdata, coroutine.work);
+ container_of(work, struct NCR5380_hostdata, main_task);
struct Scsi_Host *instance = hostdata->host;
struct scsi_cmnd *tmp, *prev;
int done;
@@ -1037,8 +1036,7 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id)
} /* if BASR_IRQ */
spin_unlock_irqrestore(instance->host_lock, flags);
if(!done)
- queue_delayed_work(hostdata->work_q,
- &hostdata->coroutine, 0);
+ queue_work(hostdata->work_q, &hostdata->main_task);
} while (!done);
return IRQ_HANDLED;
}