diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-25 23:22:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-25 23:22:55 -0400 |
commit | 71fa0a849b384f066dea6a2351c722c19846f4ac (patch) | |
tree | c6f9ac28003432ba79d0ea5eefd34ad412fb50ef /drivers/scsi/fdomain.c | |
parent | 9d81a782d55bdeec3bfa3106e514bf46ac12e172 (diff) | |
parent | d6b9ccbbeb625674891f797119f06512d27fc905 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (40 commits)
[SCSI] aic79xx: Print out signalling
[SCSI] aic7xxx: Remove slave_destroy
[SCSI] aic79xx: set precompensation
[SCSI] aic79xx: Fixup external device reset
[SCSI] replace u8 and u32 with __u8 and __u32 in scsi.h for user space
[SCSI] lpfc: fix printk format warning
[SCSI] aic79xx: make ahd_set_tags() static
[SCSI] aic7xxx: cleanups
[SCSI] drivers/scsi: Handcrafted MIN/MAX macro removal
[SCSI] scsi_debug: support REPORT TARGET PORT GROUPS
[SCSI] qla1280 bus reset typo
[SCSI] libiscsi: fix logout pdu processing
[SCSI] libiscsi: fix aen support
[SCSI] libiscsi: fix missed iscsi_task_put in xmit error path
[SCSI] libiscsi: fix oops in connection create failure path
[SCSI] iscsi class: fix slab corruption during restart
[SCSI] Switch fdomain to the pci_get API
[SCSI] add can_queue to host parameters
[SCSI] megaraid_{mm,mbox}: 64-bit DMA capability fix
[SCSI] aic94xx: Supermicro motherboards support
...
Diffstat (limited to 'drivers/scsi/fdomain.c')
-rw-r--r-- | drivers/scsi/fdomain.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 65e6e7b7ba07..5d4ea6f77953 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c | |||
@@ -387,6 +387,7 @@ static void __iomem * bios_mem; | |||
387 | static int bios_major; | 387 | static int bios_major; |
388 | static int bios_minor; | 388 | static int bios_minor; |
389 | static int PCI_bus; | 389 | static int PCI_bus; |
390 | static struct pci_dev *PCI_dev; | ||
390 | static int Quantum; /* Quantum board variant */ | 391 | static int Quantum; /* Quantum board variant */ |
391 | static int interrupt_level; | 392 | static int interrupt_level; |
392 | static volatile int in_command; | 393 | static volatile int in_command; |
@@ -812,9 +813,10 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_ | |||
812 | PCI_DEVICE_ID_FD_36C70 ); | 813 | PCI_DEVICE_ID_FD_36C70 ); |
813 | #endif | 814 | #endif |
814 | 815 | ||
815 | if ((pdev = pci_find_device(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, pdev)) == NULL) | 816 | if ((pdev = pci_get_device(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70, pdev)) == NULL) |
816 | return 0; | 817 | return 0; |
817 | if (pci_enable_device(pdev)) return 0; | 818 | if (pci_enable_device(pdev)) |
819 | goto fail; | ||
818 | 820 | ||
819 | #if DEBUG_DETECT | 821 | #if DEBUG_DETECT |
820 | printk( "scsi: <fdomain> TMC-3260 detect:" | 822 | printk( "scsi: <fdomain> TMC-3260 detect:" |
@@ -831,7 +833,7 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_ | |||
831 | pci_irq = pdev->irq; | 833 | pci_irq = pdev->irq; |
832 | 834 | ||
833 | if (!request_region( pci_base, 0x10, "fdomain" )) | 835 | if (!request_region( pci_base, 0x10, "fdomain" )) |
834 | return 0; | 836 | goto fail; |
835 | 837 | ||
836 | /* Now we have the I/O base address and interrupt from the PCI | 838 | /* Now we have the I/O base address and interrupt from the PCI |
837 | configuration registers. */ | 839 | configuration registers. */ |
@@ -848,17 +850,22 @@ static int fdomain_pci_bios_detect( int *irq, int *iobase, struct pci_dev **ret_ | |||
848 | if (!fdomain_is_valid_port(pci_base)) { | 850 | if (!fdomain_is_valid_port(pci_base)) { |
849 | printk(KERN_ERR "scsi: <fdomain> PCI card detected, but driver not loaded (invalid port)\n" ); | 851 | printk(KERN_ERR "scsi: <fdomain> PCI card detected, but driver not loaded (invalid port)\n" ); |
850 | release_region(pci_base, 0x10); | 852 | release_region(pci_base, 0x10); |
851 | return 0; | 853 | goto fail; |
852 | } | 854 | } |
853 | 855 | ||
854 | /* Fill in a few global variables. Ugh. */ | 856 | /* Fill in a few global variables. Ugh. */ |
855 | bios_major = bios_minor = -1; | 857 | bios_major = bios_minor = -1; |
856 | PCI_bus = 1; | 858 | PCI_bus = 1; |
859 | PCI_dev = pdev; | ||
857 | Quantum = 0; | 860 | Quantum = 0; |
858 | bios_base = 0; | 861 | bios_base = 0; |
859 | 862 | ||
860 | return 1; | 863 | return 1; |
864 | fail: | ||
865 | pci_dev_put(pdev); | ||
866 | return 0; | ||
861 | } | 867 | } |
868 | |||
862 | #endif | 869 | #endif |
863 | 870 | ||
864 | struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) | 871 | struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) |
@@ -909,8 +916,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) | |||
909 | if (setup_called) { | 916 | if (setup_called) { |
910 | printk(KERN_ERR "scsi: <fdomain> Bad LILO/INSMOD parameters?\n"); | 917 | printk(KERN_ERR "scsi: <fdomain> Bad LILO/INSMOD parameters?\n"); |
911 | } | 918 | } |
912 | release_region(port_base, 0x10); | 919 | goto fail; |
913 | return NULL; | ||
914 | } | 920 | } |
915 | 921 | ||
916 | if (this_id) { | 922 | if (this_id) { |
@@ -942,8 +948,7 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) | |||
942 | /* Log IRQ with kernel */ | 948 | /* Log IRQ with kernel */ |
943 | if (!interrupt_level) { | 949 | if (!interrupt_level) { |
944 | printk(KERN_ERR "scsi: <fdomain> Card Detected, but driver not loaded (no IRQ)\n" ); | 950 | printk(KERN_ERR "scsi: <fdomain> Card Detected, but driver not loaded (no IRQ)\n" ); |
945 | release_region(port_base, 0x10); | 951 | goto fail; |
946 | return NULL; | ||
947 | } else { | 952 | } else { |
948 | /* Register the IRQ with the kernel */ | 953 | /* Register the IRQ with the kernel */ |
949 | 954 | ||
@@ -964,11 +969,14 @@ struct Scsi_Host *__fdomain_16x0_detect(struct scsi_host_template *tpnt ) | |||
964 | printk(KERN_ERR " Send mail to faith@acm.org\n" ); | 969 | printk(KERN_ERR " Send mail to faith@acm.org\n" ); |
965 | } | 970 | } |
966 | printk(KERN_ERR "scsi: <fdomain> Detected, but driver not loaded (IRQ)\n" ); | 971 | printk(KERN_ERR "scsi: <fdomain> Detected, but driver not loaded (IRQ)\n" ); |
967 | release_region(port_base, 0x10); | 972 | goto fail; |
968 | return NULL; | ||
969 | } | 973 | } |
970 | } | 974 | } |
971 | return shpnt; | 975 | return shpnt; |
976 | fail: | ||
977 | pci_dev_put(pdev); | ||
978 | release_region(port_base, 0x10); | ||
979 | return NULL; | ||
972 | } | 980 | } |
973 | 981 | ||
974 | static int fdomain_16x0_detect(struct scsi_host_template *tpnt) | 982 | static int fdomain_16x0_detect(struct scsi_host_template *tpnt) |
@@ -1714,6 +1722,8 @@ static int fdomain_16x0_release(struct Scsi_Host *shpnt) | |||
1714 | free_irq(shpnt->irq, shpnt); | 1722 | free_irq(shpnt->irq, shpnt); |
1715 | if (shpnt->io_port && shpnt->n_io_port) | 1723 | if (shpnt->io_port && shpnt->n_io_port) |
1716 | release_region(shpnt->io_port, shpnt->n_io_port); | 1724 | release_region(shpnt->io_port, shpnt->n_io_port); |
1725 | if (PCI_bus) | ||
1726 | pci_dev_put(PCI_dev); | ||
1717 | return 0; | 1727 | return 0; |
1718 | } | 1728 | } |
1719 | 1729 | ||