aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx/aic94xx_init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 21:57:35 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 21:57:35 -0400
commit97d41e90fe61399b99d74820cb7f2d6e0fbac91d (patch)
treef759371424a26963b04badbb4433e360be4e8750 /drivers/scsi/aic94xx/aic94xx_init.c
parent3bdc9d0b408e01c4e556daba0035ba37f603e920 (diff)
parentafaf5a2d341d33b66b47c2716a263ce593460a08 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (54 commits) [SCSI] Initial Commit of qla4xxx [SCSI] raid class: handle component-add errors [SCSI] SCSI megaraid_sas: handle thrown errors [SCSI] SCSI aic94xx: handle sysfs errors [SCSI] SCSI st: fix error handling in module init, sysfs [SCSI] SCSI sd: fix module init/exit error handling [SCSI] SCSI osst: add error handling to module init, sysfs [SCSI] scsi: remove hosts.h [SCSI] scsi: Scsi_Cmnd convertion in aic7xxx_old.c [SCSI] megaraid_sas: sets ioctl timeout and updates version,changelog [SCSI] megaraid_sas: adds tasklet for cmd completion [SCSI] megaraid_sas: prints pending cmds before setting hw_crit_error [SCSI] megaraid_sas: function pointer for disable interrupt [SCSI] megaraid_sas: frame count optimization [SCSI] megaraid_sas: FW transition and q size changes [SCSI] qla2xxx: Update version number to 8.01.07-k2. [SCSI] qla2xxx: Stall mid-layer error handlers while rport is blocked. [SCSI] qla2xxx: Add MODULE_FIRMWARE tags. [SCSI] qla2xxx: Add support for host port state FC transport attribute. [SCSI] qla2xxx: Add support for fabric name FC transport attribute. ...
Diffstat (limited to 'drivers/scsi/aic94xx/aic94xx_init.c')
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c41
1 files changed, 33 insertions, 8 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 734adc9d5206..99743ca29ca1 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -309,11 +309,29 @@ static ssize_t asd_show_dev_pcba_sn(struct device *dev,
309} 309}
310static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL); 310static DEVICE_ATTR(pcba_sn, S_IRUGO, asd_show_dev_pcba_sn, NULL);
311 311
312static void asd_create_dev_attrs(struct asd_ha_struct *asd_ha) 312static int asd_create_dev_attrs(struct asd_ha_struct *asd_ha)
313{ 313{
314 device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision); 314 int err;
315 device_create_file(&asd_ha->pcidev->dev, &dev_attr_bios_build); 315
316 device_create_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn); 316 err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_revision);
317 if (err)
318 return err;
319
320 err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
321 if (err)
322 goto err_rev;
323
324 err = device_create_file(&asd_ha->pcidev->dev, &dev_attr_pcba_sn);
325 if (err)
326 goto err_biosb;
327
328 return 0;
329
330err_biosb:
331 device_remove_file(&asd_ha->pcidev->dev, &dev_attr_bios_build);
332err_rev:
333 device_remove_file(&asd_ha->pcidev->dev, &dev_attr_revision);
334 return err;
317} 335}
318 336
319static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha) 337static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
@@ -645,7 +663,9 @@ static int __devinit asd_pci_probe(struct pci_dev *dev,
645 } 663 }
646 ASD_DPRINTK("escbs posted\n"); 664 ASD_DPRINTK("escbs posted\n");
647 665
648 asd_create_dev_attrs(asd_ha); 666 err = asd_create_dev_attrs(asd_ha);
667 if (err)
668 goto Err_dev_attrs;
649 669
650 err = asd_register_sas_ha(asd_ha); 670 err = asd_register_sas_ha(asd_ha);
651 if (err) 671 if (err)
@@ -668,6 +688,7 @@ Err_en_phys:
668 asd_unregister_sas_ha(asd_ha); 688 asd_unregister_sas_ha(asd_ha);
669Err_reg_sas: 689Err_reg_sas:
670 asd_remove_dev_attrs(asd_ha); 690 asd_remove_dev_attrs(asd_ha);
691Err_dev_attrs:
671Err_escbs: 692Err_escbs:
672 asd_disable_ints(asd_ha); 693 asd_disable_ints(asd_ha);
673 free_irq(dev->irq, asd_ha); 694 free_irq(dev->irq, asd_ha);
@@ -754,9 +775,9 @@ static ssize_t asd_version_show(struct device_driver *driver, char *buf)
754} 775}
755static DRIVER_ATTR(version, S_IRUGO, asd_version_show, NULL); 776static DRIVER_ATTR(version, S_IRUGO, asd_version_show, NULL);
756 777
757static void asd_create_driver_attrs(struct device_driver *driver) 778static int asd_create_driver_attrs(struct device_driver *driver)
758{ 779{
759 driver_create_file(driver, &driver_attr_version); 780 return driver_create_file(driver, &driver_attr_version);
760} 781}
761 782
762static void asd_remove_driver_attrs(struct device_driver *driver) 783static void asd_remove_driver_attrs(struct device_driver *driver)
@@ -834,10 +855,14 @@ static int __init aic94xx_init(void)
834 if (err) 855 if (err)
835 goto out_release_transport; 856 goto out_release_transport;
836 857
837 asd_create_driver_attrs(&aic94xx_pci_driver.driver); 858 err = asd_create_driver_attrs(&aic94xx_pci_driver.driver);
859 if (err)
860 goto out_unregister_pcidrv;
838 861
839 return err; 862 return err;
840 863
864 out_unregister_pcidrv:
865 pci_unregister_driver(&aic94xx_pci_driver);
841 out_release_transport: 866 out_release_transport:
842 sas_release_transport(aic94xx_transport_template); 867 sas_release_transport(aic94xx_transport_template);
843 out_destroy_caches: 868 out_destroy_caches: