aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zary <linux@rainbow-software.org>2015-02-06 17:11:28 -0500
committerJames Bottomley <JBottomley@Odin.com>2015-04-09 21:06:47 -0400
commit09a44833887dfc856facff0a9b21f3def0367f0c (patch)
tree93098a7ae60e9f6c5fa469ae5515cde5abdf84c8
parentcb5b570ce3cc7e91f47339e60efba75a4bbc347c (diff)
aha1542: Reorder functions to remove forward declarations
Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r--drivers/scsi/aha1542.c51
-rw-r--r--drivers/scsi/aha1542.h12
2 files changed, 24 insertions, 39 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 8851719d8d0e..af1e8fa41413 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -124,10 +124,6 @@ static DEFINE_SPINLOCK(aha1542_lock);
124 124
125#define WAITnexttimeout 3000000 125#define WAITnexttimeout 3000000
126 126
127static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt);
128static int aha1542_restart(struct Scsi_Host *shost);
129static void aha1542_intr_handle(struct Scsi_Host *shost);
130
131static inline void aha1542_intr_reset(u16 base) 127static inline void aha1542_intr_reset(u16 base)
132{ 128{
133 outb(IRST, CONTROL(base)); 129 outb(IRST, CONTROL(base));
@@ -368,16 +364,20 @@ fail:
368 return 0; /* 0 = not ok */ 364 return 0; /* 0 = not ok */
369} 365}
370 366
371/* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */ 367static int aha1542_restart(struct Scsi_Host *shost)
372static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
373{ 368{
374 unsigned long flags; 369 struct aha1542_hostdata *aha1542 = shost_priv(shost);
375 struct Scsi_Host *shost = dev_id; 370 int i;
371 int count = 0;
376 372
377 spin_lock_irqsave(shost->host_lock, flags); 373 for (i = 0; i < AHA1542_MAILBOXES; i++)
378 aha1542_intr_handle(shost); 374 if (aha1542->SCint[i] &&
379 spin_unlock_irqrestore(shost->host_lock, flags); 375 !(aha1542->SCint[i]->device->soft_reset)) {
380 return IRQ_HANDLED; 376 count++;
377 }
378 printk(KERN_DEBUG "Potential to restart %d stalled commands...\n", count);
379
380 return 0;
381} 381}
382 382
383/* A "high" level interrupt handler */ 383/* A "high" level interrupt handler */
@@ -539,6 +539,18 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
539 }; 539 };
540} 540}
541 541
542/* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */
543static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
544{
545 unsigned long flags;
546 struct Scsi_Host *shost = dev_id;
547
548 spin_lock_irqsave(shost->host_lock, flags);
549 aha1542_intr_handle(shost);
550 spin_unlock_irqrestore(shost->host_lock, flags);
551 return IRQ_HANDLED;
552}
553
542static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) 554static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
543{ 555{
544 struct aha1542_hostdata *aha1542 = shost_priv(SCpnt->device->host); 556 struct aha1542_hostdata *aha1542 = shost_priv(SCpnt->device->host);
@@ -1078,21 +1090,6 @@ static int aha1542_release(struct Scsi_Host *shost)
1078 return 0; 1090 return 0;
1079} 1091}
1080 1092
1081static int aha1542_restart(struct Scsi_Host *shost)
1082{
1083 struct aha1542_hostdata *aha1542 = shost_priv(shost);
1084 int i;
1085 int count = 0;
1086
1087 for (i = 0; i < AHA1542_MAILBOXES; i++)
1088 if (aha1542->SCint[i] &&
1089 !(aha1542->SCint[i]->device->soft_reset)) {
1090 count++;
1091 }
1092 printk(KERN_DEBUG "Potential to restart %d stalled commands...\n", count);
1093
1094 return 0;
1095}
1096 1093
1097/* 1094/*
1098 * This is a device reset. This is handled by sending a special command 1095 * This is a device reset. This is handled by sending a special command
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h
index 6b418bbdc9f9..f0b862b6d56a 100644
--- a/drivers/scsi/aha1542.h
+++ b/drivers/scsi/aha1542.h
@@ -125,18 +125,6 @@ struct ccb { /* Command Control Block 5.3 */
125 /* REQUEST SENSE */ 125 /* REQUEST SENSE */
126}; 126};
127 127
128static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct device *pdev, int indx);
129static int aha1542_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);
130static int aha1542_bus_reset(Scsi_Cmnd * SCpnt);
131static int aha1542_dev_reset(Scsi_Cmnd * SCpnt);
132static int aha1542_host_reset(Scsi_Cmnd * SCpnt);
133#if 0
134static int aha1542_old_abort(Scsi_Cmnd * SCpnt);
135static int aha1542_old_reset(Scsi_Cmnd *, unsigned int);
136#endif
137static int aha1542_biosparam(struct scsi_device *, struct block_device *,
138 sector_t, int *);
139
140#define AHA1542_MAILBOXES 8 128#define AHA1542_MAILBOXES 8
141 129
142#endif 130#endif