aha1542: Always name Scsi_Host variables sh
Make Scsi_Host variable names consistent - use sh everywhere. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <JBottomley@Odin.com>
This commit is contained in:
parent
55b28f9fc0
commit
c2532f6826
|
@ -241,7 +241,7 @@ static int makecode(unsigned hosterr, unsigned scsierr)
|
||||||
return scsierr | (hosterr << 16);
|
return scsierr | (hosterr << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aha1542_test_port(int bse, struct Scsi_Host *shpnt)
|
static int aha1542_test_port(int bse, struct Scsi_Host *sh)
|
||||||
{
|
{
|
||||||
u8 inquiry_result[4];
|
u8 inquiry_result[4];
|
||||||
int i;
|
int i;
|
||||||
|
@ -293,9 +293,9 @@ static int aha1542_test_port(int bse, struct Scsi_Host *shpnt)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A "high" level interrupt handler */
|
/* A "high" level interrupt handler */
|
||||||
static void aha1542_intr_handle(struct Scsi_Host *shost)
|
static void aha1542_intr_handle(struct Scsi_Host *sh)
|
||||||
{
|
{
|
||||||
struct aha1542_hostdata *aha1542 = shost_priv(shost);
|
struct aha1542_hostdata *aha1542 = shost_priv(sh);
|
||||||
void (*my_done)(struct scsi_cmnd *) = NULL;
|
void (*my_done)(struct scsi_cmnd *) = NULL;
|
||||||
int errstatus, mbi, mbo, mbistatus;
|
int errstatus, mbi, mbo, mbistatus;
|
||||||
int number_serviced;
|
int number_serviced;
|
||||||
|
@ -307,7 +307,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
{
|
{
|
||||||
flag = inb(INTRFLAGS(shost->io_port));
|
flag = inb(INTRFLAGS(sh->io_port));
|
||||||
printk(KERN_DEBUG "aha1542_intr_handle: ");
|
printk(KERN_DEBUG "aha1542_intr_handle: ");
|
||||||
if (!(flag & ANYINTR))
|
if (!(flag & ANYINTR))
|
||||||
printk("no interrupt?");
|
printk("no interrupt?");
|
||||||
|
@ -319,13 +319,13 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
|
||||||
printk("HACC ");
|
printk("HACC ");
|
||||||
if (flag & SCRD)
|
if (flag & SCRD)
|
||||||
printk("SCRD ");
|
printk("SCRD ");
|
||||||
printk("status %02x\n", inb(STATUS(shost->io_port)));
|
printk("status %02x\n", inb(STATUS(sh->io_port)));
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
number_serviced = 0;
|
number_serviced = 0;
|
||||||
|
|
||||||
while (1 == 1) {
|
while (1 == 1) {
|
||||||
flag = inb(INTRFLAGS(shost->io_port));
|
flag = inb(INTRFLAGS(sh->io_port));
|
||||||
|
|
||||||
/* Check for unusual interrupts. If any of these happen, we should
|
/* Check for unusual interrupts. If any of these happen, we should
|
||||||
probably do something special, but for now just printing a message
|
probably do something special, but for now just printing a message
|
||||||
|
@ -339,7 +339,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
|
||||||
if (flag & SCRD)
|
if (flag & SCRD)
|
||||||
printk("SCRD ");
|
printk("SCRD ");
|
||||||
}
|
}
|
||||||
aha1542_intr_reset(shost->io_port);
|
aha1542_intr_reset(sh->io_port);
|
||||||
|
|
||||||
spin_lock_irqsave(&aha1542_lock, flags);
|
spin_lock_irqsave(&aha1542_lock, flags);
|
||||||
mbi = aha1542->aha1542_last_mbi_used + 1;
|
mbi = aha1542->aha1542_last_mbi_used + 1;
|
||||||
|
@ -447,11 +447,11 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
|
||||||
static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
|
static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct Scsi_Host *shost = dev_id;
|
struct Scsi_Host *sh = dev_id;
|
||||||
|
|
||||||
spin_lock_irqsave(shost->host_lock, flags);
|
spin_lock_irqsave(sh->host_lock, flags);
|
||||||
aha1542_intr_handle(shost);
|
aha1542_intr_handle(sh);
|
||||||
spin_unlock_irqrestore(shost->host_lock, flags);
|
spin_unlock_irqrestore(sh->host_lock, flags);
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,9 +605,9 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct
|
||||||
static DEF_SCSI_QCMD(aha1542_queuecommand)
|
static DEF_SCSI_QCMD(aha1542_queuecommand)
|
||||||
|
|
||||||
/* Initialize mailboxes */
|
/* Initialize mailboxes */
|
||||||
static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
|
static void setup_mailboxes(int bse, struct Scsi_Host *sh)
|
||||||
{
|
{
|
||||||
struct aha1542_hostdata *aha1542 = shost_priv(shpnt);
|
struct aha1542_hostdata *aha1542 = shost_priv(sh);
|
||||||
int i;
|
int i;
|
||||||
struct mailbox *mb = aha1542->mb;
|
struct mailbox *mb = aha1542->mb;
|
||||||
struct ccb *ccb = aha1542->ccb;
|
struct ccb *ccb = aha1542->ccb;
|
||||||
|
@ -817,7 +817,7 @@ fail:
|
||||||
static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct device *pdev, int indx)
|
static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct device *pdev, int indx)
|
||||||
{
|
{
|
||||||
unsigned int base_io = io[indx];
|
unsigned int base_io = io[indx];
|
||||||
struct Scsi_Host *shpnt;
|
struct Scsi_Host *sh;
|
||||||
struct aha1542_hostdata *aha1542;
|
struct aha1542_hostdata *aha1542;
|
||||||
|
|
||||||
if (base_io == 0)
|
if (base_io == 0)
|
||||||
|
@ -826,80 +826,80 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct
|
||||||
if (!request_region(base_io, AHA1542_REGION_SIZE, "aha1542"))
|
if (!request_region(base_io, AHA1542_REGION_SIZE, "aha1542"))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
shpnt = scsi_host_alloc(tpnt, sizeof(struct aha1542_hostdata));
|
sh = scsi_host_alloc(tpnt, sizeof(struct aha1542_hostdata));
|
||||||
if (!shpnt)
|
if (!sh)
|
||||||
goto release;
|
goto release;
|
||||||
aha1542 = shost_priv(shpnt);
|
aha1542 = shost_priv(sh);
|
||||||
|
|
||||||
if (!aha1542_test_port(base_io, shpnt))
|
if (!aha1542_test_port(base_io, sh))
|
||||||
goto unregister;
|
goto unregister;
|
||||||
|
|
||||||
aha1542_set_bus_times(indx);
|
aha1542_set_bus_times(indx);
|
||||||
if (aha1542_query(base_io, &aha1542->bios_translation))
|
if (aha1542_query(base_io, &aha1542->bios_translation))
|
||||||
goto unregister;
|
goto unregister;
|
||||||
if (aha1542_getconfig(base_io, &shpnt->irq, &shpnt->dma_channel, &shpnt->this_id) == -1)
|
if (aha1542_getconfig(base_io, &sh->irq, &sh->dma_channel, &sh->this_id) == -1)
|
||||||
goto unregister;
|
goto unregister;
|
||||||
|
|
||||||
printk(KERN_INFO "Adaptec AHA-1542 (SCSI-ID %d) at IO 0x%x, IRQ %d", shpnt->this_id, base_io, shpnt->irq);
|
printk(KERN_INFO "Adaptec AHA-1542 (SCSI-ID %d) at IO 0x%x, IRQ %d", sh->this_id, base_io, sh->irq);
|
||||||
if (shpnt->dma_channel != 0xFF)
|
if (sh->dma_channel != 0xFF)
|
||||||
printk(", DMA %d", shpnt->dma_channel);
|
printk(", DMA %d", sh->dma_channel);
|
||||||
printk("\n");
|
printk("\n");
|
||||||
if (aha1542->bios_translation == BIOS_TRANSLATION_25563)
|
if (aha1542->bios_translation == BIOS_TRANSLATION_25563)
|
||||||
printk(KERN_INFO "aha1542.c: Using extended bios translation\n");
|
printk(KERN_INFO "aha1542.c: Using extended bios translation\n");
|
||||||
|
|
||||||
setup_mailboxes(base_io, shpnt);
|
setup_mailboxes(base_io, sh);
|
||||||
|
|
||||||
if (request_irq(shpnt->irq, do_aha1542_intr_handle, 0,
|
if (request_irq(sh->irq, do_aha1542_intr_handle, 0,
|
||||||
"aha1542", shpnt)) {
|
"aha1542", sh)) {
|
||||||
printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n");
|
printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n");
|
||||||
goto unregister;
|
goto unregister;
|
||||||
}
|
}
|
||||||
if (shpnt->dma_channel != 0xFF) {
|
if (sh->dma_channel != 0xFF) {
|
||||||
if (request_dma(shpnt->dma_channel, "aha1542")) {
|
if (request_dma(sh->dma_channel, "aha1542")) {
|
||||||
printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n");
|
printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n");
|
||||||
goto free_irq;
|
goto free_irq;
|
||||||
}
|
}
|
||||||
if (shpnt->dma_channel == 0 || shpnt->dma_channel >= 5) {
|
if (sh->dma_channel == 0 || sh->dma_channel >= 5) {
|
||||||
set_dma_mode(shpnt->dma_channel, DMA_MODE_CASCADE);
|
set_dma_mode(sh->dma_channel, DMA_MODE_CASCADE);
|
||||||
enable_dma(shpnt->dma_channel);
|
enable_dma(sh->dma_channel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
shpnt->unique_id = base_io;
|
sh->unique_id = base_io;
|
||||||
shpnt->io_port = base_io;
|
sh->io_port = base_io;
|
||||||
shpnt->n_io_port = AHA1542_REGION_SIZE;
|
sh->n_io_port = AHA1542_REGION_SIZE;
|
||||||
aha1542->aha1542_last_mbi_used = 2 * AHA1542_MAILBOXES - 1;
|
aha1542->aha1542_last_mbi_used = 2 * AHA1542_MAILBOXES - 1;
|
||||||
aha1542->aha1542_last_mbo_used = AHA1542_MAILBOXES - 1;
|
aha1542->aha1542_last_mbo_used = AHA1542_MAILBOXES - 1;
|
||||||
|
|
||||||
if (scsi_add_host(shpnt, pdev))
|
if (scsi_add_host(sh, pdev))
|
||||||
goto free_dma;
|
goto free_dma;
|
||||||
|
|
||||||
scsi_scan_host(shpnt);
|
scsi_scan_host(sh);
|
||||||
|
|
||||||
return shpnt;
|
return sh;
|
||||||
free_dma:
|
free_dma:
|
||||||
if (shpnt->dma_channel != 0xff)
|
if (sh->dma_channel != 0xff)
|
||||||
free_dma(shpnt->dma_channel);
|
free_dma(sh->dma_channel);
|
||||||
free_irq:
|
free_irq:
|
||||||
free_irq(shpnt->irq, shpnt);
|
free_irq(sh->irq, sh);
|
||||||
unregister:
|
unregister:
|
||||||
scsi_host_put(shpnt);
|
scsi_host_put(sh);
|
||||||
release:
|
release:
|
||||||
release_region(base_io, AHA1542_REGION_SIZE);
|
release_region(base_io, AHA1542_REGION_SIZE);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int aha1542_release(struct Scsi_Host *shost)
|
static int aha1542_release(struct Scsi_Host *sh)
|
||||||
{
|
{
|
||||||
scsi_remove_host(shost);
|
scsi_remove_host(sh);
|
||||||
if (shost->dma_channel != 0xff)
|
if (sh->dma_channel != 0xff)
|
||||||
free_dma(shost->dma_channel);
|
free_dma(sh->dma_channel);
|
||||||
if (shost->irq)
|
if (sh->irq)
|
||||||
free_irq(shost->irq, shost);
|
free_irq(sh->irq, sh);
|
||||||
if (shost->io_port && shost->n_io_port)
|
if (sh->io_port && sh->n_io_port)
|
||||||
release_region(shost->io_port, shost->n_io_port);
|
release_region(sh->io_port, sh->n_io_port);
|
||||||
scsi_host_put(shost);
|
scsi_host_put(sh);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue