Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] aha1542: minor irq handler cleanups

- where the 'irq' function argument is known never to be used, rename
it to 'dummy' to make this more obvious

- replace per-irq lookup functions and tables with a direct reference
to data object obtained via 'dev_id' function argument, passed from
request_irq()

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

Jeff Garzik and committed by
James Bottomley
87c4d7bc 9f9a73b6

+10 -16
+10 -16
drivers/scsi/aha1542.c
··· 153 153 154 154 #define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata) 155 155 156 - static struct Scsi_Host *aha_host[7]; /* One for each IRQ level (9-15) */ 157 - 158 156 static DEFINE_SPINLOCK(aha1542_lock); 159 157 160 158 ··· 161 163 162 164 static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt); 163 165 static int aha1542_restart(struct Scsi_Host *shost); 164 - static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id); 165 - static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id); 166 + static void aha1542_intr_handle(struct Scsi_Host *shost); 166 167 167 168 #define aha1542_intr_reset(base) outb(IRST, CONTROL(base)) 168 169 ··· 401 404 } 402 405 403 406 /* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */ 404 - static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id) 407 + static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id) 405 408 { 406 409 unsigned long flags; 407 - struct Scsi_Host *shost; 408 - 409 - shost = aha_host[irq - 9]; 410 - if (!shost) 411 - panic("Splunge!"); 410 + struct Scsi_Host *shost = dev_id; 412 411 413 412 spin_lock_irqsave(shost->host_lock, flags); 414 - aha1542_intr_handle(shost, dev_id); 413 + aha1542_intr_handle(shost); 415 414 spin_unlock_irqrestore(shost->host_lock, flags); 416 415 return IRQ_HANDLED; 417 416 } 418 417 419 418 /* A "high" level interrupt handler */ 420 - static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id) 419 + static void aha1542_intr_handle(struct Scsi_Host *shost) 421 420 { 422 421 void (*my_done) (Scsi_Cmnd *) = NULL; 423 422 int errstatus, mbi, mbo, mbistatus; ··· 1190 1197 1191 1198 DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level)); 1192 1199 spin_lock_irqsave(&aha1542_lock, flags); 1193 - if (request_irq(irq_level, do_aha1542_intr_handle, 0, "aha1542", NULL)) { 1200 + if (request_irq(irq_level, do_aha1542_intr_handle, 0, 1201 + "aha1542", shpnt)) { 1194 1202 printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n"); 1195 1203 spin_unlock_irqrestore(&aha1542_lock, flags); 1196 1204 goto unregister; ··· 1199 1205 if (dma_chan != 0xFF) { 1200 1206 if (request_dma(dma_chan, "aha1542")) { 1201 1207 printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n"); 1202 - free_irq(irq_level, NULL); 1208 + free_irq(irq_level, shpnt); 1203 1209 spin_unlock_irqrestore(&aha1542_lock, flags); 1204 1210 goto unregister; 1205 1211 } ··· 1208 1214 enable_dma(dma_chan); 1209 1215 } 1210 1216 } 1211 - aha_host[irq_level - 9] = shpnt; 1217 + 1212 1218 shpnt->this_id = scsi_id; 1213 1219 shpnt->unique_id = base_io; 1214 1220 shpnt->io_port = base_io; ··· 1270 1276 static int aha1542_release(struct Scsi_Host *shost) 1271 1277 { 1272 1278 if (shost->irq) 1273 - free_irq(shost->irq, NULL); 1279 + free_irq(shost->irq, shost); 1274 1280 if (shost->dma_channel != 0xff) 1275 1281 free_dma(shost->dma_channel); 1276 1282 if (shost->io_port && shost->n_io_port)