diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:45 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:08:26 -0400 |
commit | c2532f68266d3b10fe71e0b3e63f4c29d73e6ee5 (patch) | |
tree | 945d14030f8ed86e19530d56d5319c6a4ee58285 | |
parent | 55b28f9fc033f9af090a58ea97063ca51552a2a6 (diff) |
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>
-rw-r--r-- | drivers/scsi/aha1542.c | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index dcc493de68e7..7b066984ebbf 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -241,7 +241,7 @@ static int makecode(unsigned hosterr, unsigned scsierr) | |||
241 | return scsierr | (hosterr << 16); | 241 | return scsierr | (hosterr << 16); |
242 | } | 242 | } |
243 | 243 | ||
244 | static int aha1542_test_port(int bse, struct Scsi_Host *shpnt) | 244 | static int aha1542_test_port(int bse, struct Scsi_Host *sh) |
245 | { | 245 | { |
246 | u8 inquiry_result[4]; | 246 | u8 inquiry_result[4]; |
247 | int i; | 247 | int i; |
@@ -293,9 +293,9 @@ static int aha1542_test_port(int bse, struct Scsi_Host *shpnt) | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /* A "high" level interrupt handler */ | 295 | /* A "high" level interrupt handler */ |
296 | static void aha1542_intr_handle(struct Scsi_Host *shost) | 296 | static void aha1542_intr_handle(struct Scsi_Host *sh) |
297 | { | 297 | { |
298 | struct aha1542_hostdata *aha1542 = shost_priv(shost); | 298 | struct aha1542_hostdata *aha1542 = shost_priv(sh); |
299 | void (*my_done)(struct scsi_cmnd *) = NULL; | 299 | void (*my_done)(struct scsi_cmnd *) = NULL; |
300 | int errstatus, mbi, mbo, mbistatus; | 300 | int errstatus, mbi, mbo, mbistatus; |
301 | int number_serviced; | 301 | int number_serviced; |
@@ -307,7 +307,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
307 | 307 | ||
308 | #ifdef DEBUG | 308 | #ifdef DEBUG |
309 | { | 309 | { |
310 | flag = inb(INTRFLAGS(shost->io_port)); | 310 | flag = inb(INTRFLAGS(sh->io_port)); |
311 | printk(KERN_DEBUG "aha1542_intr_handle: "); | 311 | printk(KERN_DEBUG "aha1542_intr_handle: "); |
312 | if (!(flag & ANYINTR)) | 312 | if (!(flag & ANYINTR)) |
313 | printk("no interrupt?"); | 313 | printk("no interrupt?"); |
@@ -319,13 +319,13 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
319 | printk("HACC "); | 319 | printk("HACC "); |
320 | if (flag & SCRD) | 320 | if (flag & SCRD) |
321 | printk("SCRD "); | 321 | printk("SCRD "); |
322 | printk("status %02x\n", inb(STATUS(shost->io_port))); | 322 | printk("status %02x\n", inb(STATUS(sh->io_port))); |
323 | }; | 323 | }; |
324 | #endif | 324 | #endif |
325 | number_serviced = 0; | 325 | number_serviced = 0; |
326 | 326 | ||
327 | while (1 == 1) { | 327 | while (1 == 1) { |
328 | flag = inb(INTRFLAGS(shost->io_port)); | 328 | flag = inb(INTRFLAGS(sh->io_port)); |
329 | 329 | ||
330 | /* Check for unusual interrupts. If any of these happen, we should | 330 | /* Check for unusual interrupts. If any of these happen, we should |
331 | probably do something special, but for now just printing a message | 331 | probably do something special, but for now just printing a message |
@@ -339,7 +339,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
339 | if (flag & SCRD) | 339 | if (flag & SCRD) |
340 | printk("SCRD "); | 340 | printk("SCRD "); |
341 | } | 341 | } |
342 | aha1542_intr_reset(shost->io_port); | 342 | aha1542_intr_reset(sh->io_port); |
343 | 343 | ||
344 | spin_lock_irqsave(&aha1542_lock, flags); | 344 | spin_lock_irqsave(&aha1542_lock, flags); |
345 | mbi = aha1542->aha1542_last_mbi_used + 1; | 345 | mbi = aha1542->aha1542_last_mbi_used + 1; |
@@ -447,11 +447,11 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
447 | static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id) | 447 | static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id) |
448 | { | 448 | { |
449 | unsigned long flags; | 449 | unsigned long flags; |
450 | struct Scsi_Host *shost = dev_id; | 450 | struct Scsi_Host *sh = dev_id; |
451 | 451 | ||
452 | spin_lock_irqsave(shost->host_lock, flags); | 452 | spin_lock_irqsave(sh->host_lock, flags); |
453 | aha1542_intr_handle(shost); | 453 | aha1542_intr_handle(sh); |
454 | spin_unlock_irqrestore(shost->host_lock, flags); | 454 | spin_unlock_irqrestore(sh->host_lock, flags); |
455 | return IRQ_HANDLED; | 455 | return IRQ_HANDLED; |
456 | } | 456 | } |
457 | 457 | ||
@@ -605,9 +605,9 @@ static int aha1542_queuecommand_lck(struct scsi_cmnd *cmd, void (*done) (struct | |||
605 | static DEF_SCSI_QCMD(aha1542_queuecommand) | 605 | static DEF_SCSI_QCMD(aha1542_queuecommand) |
606 | 606 | ||
607 | /* Initialize mailboxes */ | 607 | /* Initialize mailboxes */ |
608 | static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) | 608 | static void setup_mailboxes(int bse, struct Scsi_Host *sh) |
609 | { | 609 | { |
610 | struct aha1542_hostdata *aha1542 = shost_priv(shpnt); | 610 | struct aha1542_hostdata *aha1542 = shost_priv(sh); |
611 | int i; | 611 | int i; |
612 | struct mailbox *mb = aha1542->mb; | 612 | struct mailbox *mb = aha1542->mb; |
613 | struct ccb *ccb = aha1542->ccb; | 613 | struct ccb *ccb = aha1542->ccb; |
@@ -817,7 +817,7 @@ fail: | |||
817 | static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct device *pdev, int indx) | 817 | static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct device *pdev, int indx) |
818 | { | 818 | { |
819 | unsigned int base_io = io[indx]; | 819 | unsigned int base_io = io[indx]; |
820 | struct Scsi_Host *shpnt; | 820 | struct Scsi_Host *sh; |
821 | struct aha1542_hostdata *aha1542; | 821 | struct aha1542_hostdata *aha1542; |
822 | 822 | ||
823 | if (base_io == 0) | 823 | if (base_io == 0) |
@@ -826,80 +826,80 @@ static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct | |||
826 | if (!request_region(base_io, AHA1542_REGION_SIZE, "aha1542")) | 826 | if (!request_region(base_io, AHA1542_REGION_SIZE, "aha1542")) |
827 | return NULL; | 827 | return NULL; |
828 | 828 | ||
829 | shpnt = scsi_host_alloc(tpnt, sizeof(struct aha1542_hostdata)); | 829 | sh = scsi_host_alloc(tpnt, sizeof(struct aha1542_hostdata)); |
830 | if (!shpnt) | 830 | if (!sh) |
831 | goto release; | 831 | goto release; |
832 | aha1542 = shost_priv(shpnt); | 832 | aha1542 = shost_priv(sh); |
833 | 833 | ||
834 | if (!aha1542_test_port(base_io, shpnt)) | 834 | if (!aha1542_test_port(base_io, sh)) |
835 | goto unregister; | 835 | goto unregister; |
836 | 836 | ||
837 | aha1542_set_bus_times(indx); | 837 | aha1542_set_bus_times(indx); |
838 | if (aha1542_query(base_io, &aha1542->bios_translation)) | 838 | if (aha1542_query(base_io, &aha1542->bios_translation)) |
839 | goto unregister; | 839 | goto unregister; |
840 | if (aha1542_getconfig(base_io, &shpnt->irq, &shpnt->dma_channel, &shpnt->this_id) == -1) | 840 | if (aha1542_getconfig(base_io, &sh->irq, &sh->dma_channel, &sh->this_id) == -1) |
841 | goto unregister; | 841 | goto unregister; |
842 | 842 | ||
843 | printk(KERN_INFO "Adaptec AHA-1542 (SCSI-ID %d) at IO 0x%x, IRQ %d", shpnt->this_id, base_io, shpnt->irq); | 843 | printk(KERN_INFO "Adaptec AHA-1542 (SCSI-ID %d) at IO 0x%x, IRQ %d", sh->this_id, base_io, sh->irq); |
844 | if (shpnt->dma_channel != 0xFF) | 844 | if (sh->dma_channel != 0xFF) |
845 | printk(", DMA %d", shpnt->dma_channel); | 845 | printk(", DMA %d", sh->dma_channel); |
846 | printk("\n"); | 846 | printk("\n"); |
847 | if (aha1542->bios_translation == BIOS_TRANSLATION_25563) | 847 | if (aha1542->bios_translation == BIOS_TRANSLATION_25563) |
848 | printk(KERN_INFO "aha1542.c: Using extended bios translation\n"); | 848 | printk(KERN_INFO "aha1542.c: Using extended bios translation\n"); |
849 | 849 | ||
850 | setup_mailboxes(base_io, shpnt); | 850 | setup_mailboxes(base_io, sh); |
851 | 851 | ||
852 | if (request_irq(shpnt->irq, do_aha1542_intr_handle, 0, | 852 | if (request_irq(sh->irq, do_aha1542_intr_handle, 0, |
853 | "aha1542", shpnt)) { | 853 | "aha1542", sh)) { |
854 | printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n"); | 854 | printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n"); |
855 | goto unregister; | 855 | goto unregister; |
856 | } | 856 | } |
857 | if (shpnt->dma_channel != 0xFF) { | 857 | if (sh->dma_channel != 0xFF) { |
858 | if (request_dma(shpnt->dma_channel, "aha1542")) { | 858 | if (request_dma(sh->dma_channel, "aha1542")) { |
859 | printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n"); | 859 | printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n"); |
860 | goto free_irq; | 860 | goto free_irq; |
861 | } | 861 | } |
862 | if (shpnt->dma_channel == 0 || shpnt->dma_channel >= 5) { | 862 | if (sh->dma_channel == 0 || sh->dma_channel >= 5) { |
863 | set_dma_mode(shpnt->dma_channel, DMA_MODE_CASCADE); | 863 | set_dma_mode(sh->dma_channel, DMA_MODE_CASCADE); |
864 | enable_dma(shpnt->dma_channel); | 864 | enable_dma(sh->dma_channel); |
865 | } | 865 | } |
866 | } | 866 | } |
867 | 867 | ||
868 | shpnt->unique_id = base_io; | 868 | sh->unique_id = base_io; |
869 | shpnt->io_port = base_io; | 869 | sh->io_port = base_io; |
870 | shpnt->n_io_port = AHA1542_REGION_SIZE; | 870 | sh->n_io_port = AHA1542_REGION_SIZE; |
871 | aha1542->aha1542_last_mbi_used = 2 * AHA1542_MAILBOXES - 1; | 871 | aha1542->aha1542_last_mbi_used = 2 * AHA1542_MAILBOXES - 1; |
872 | aha1542->aha1542_last_mbo_used = AHA1542_MAILBOXES - 1; | 872 | aha1542->aha1542_last_mbo_used = AHA1542_MAILBOXES - 1; |
873 | 873 | ||
874 | if (scsi_add_host(shpnt, pdev)) | 874 | if (scsi_add_host(sh, pdev)) |
875 | goto free_dma; | 875 | goto free_dma; |
876 | 876 | ||
877 | scsi_scan_host(shpnt); | 877 | scsi_scan_host(sh); |
878 | 878 | ||
879 | return shpnt; | 879 | return sh; |
880 | free_dma: | 880 | free_dma: |
881 | if (shpnt->dma_channel != 0xff) | 881 | if (sh->dma_channel != 0xff) |
882 | free_dma(shpnt->dma_channel); | 882 | free_dma(sh->dma_channel); |
883 | free_irq: | 883 | free_irq: |
884 | free_irq(shpnt->irq, shpnt); | 884 | free_irq(sh->irq, sh); |
885 | unregister: | 885 | unregister: |
886 | scsi_host_put(shpnt); | 886 | scsi_host_put(sh); |
887 | release: | 887 | release: |
888 | release_region(base_io, AHA1542_REGION_SIZE); | 888 | release_region(base_io, AHA1542_REGION_SIZE); |
889 | 889 | ||
890 | return NULL; | 890 | return NULL; |
891 | } | 891 | } |
892 | 892 | ||
893 | static int aha1542_release(struct Scsi_Host *shost) | 893 | static int aha1542_release(struct Scsi_Host *sh) |
894 | { | 894 | { |
895 | scsi_remove_host(shost); | 895 | scsi_remove_host(sh); |
896 | if (shost->dma_channel != 0xff) | 896 | if (sh->dma_channel != 0xff) |
897 | free_dma(shost->dma_channel); | 897 | free_dma(sh->dma_channel); |
898 | if (shost->irq) | 898 | if (sh->irq) |
899 | free_irq(shost->irq, shost); | 899 | free_irq(sh->irq, sh); |
900 | if (shost->io_port && shost->n_io_port) | 900 | if (sh->io_port && sh->n_io_port) |
901 | release_region(shost->io_port, shost->n_io_port); | 901 | release_region(sh->io_port, sh->n_io_port); |
902 | scsi_host_put(shost); | 902 | scsi_host_put(sh); |
903 | return 0; | 903 | return 0; |
904 | } | 904 | } |
905 | 905 | ||