aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd.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/sd.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/sd.c')
-rw-r--r--drivers/scsi/sd.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 10bc99c911fa..84ff203ffedd 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1794,7 +1794,7 @@ static void sd_shutdown(struct device *dev)
1794 **/ 1794 **/
1795static int __init init_sd(void) 1795static int __init init_sd(void)
1796{ 1796{
1797 int majors = 0, i; 1797 int majors = 0, i, err;
1798 1798
1799 SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n")); 1799 SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n"));
1800 1800
@@ -1805,9 +1805,22 @@ static int __init init_sd(void)
1805 if (!majors) 1805 if (!majors)
1806 return -ENODEV; 1806 return -ENODEV;
1807 1807
1808 class_register(&sd_disk_class); 1808 err = class_register(&sd_disk_class);
1809 if (err)
1810 goto err_out;
1809 1811
1810 return scsi_register_driver(&sd_template.gendrv); 1812 err = scsi_register_driver(&sd_template.gendrv);
1813 if (err)
1814 goto err_out_class;
1815
1816 return 0;
1817
1818err_out_class:
1819 class_unregister(&sd_disk_class);
1820err_out:
1821 for (i = 0; i < SD_MAJORS; i++)
1822 unregister_blkdev(sd_major(i), "sd");
1823 return err;
1811} 1824}
1812 1825
1813/** 1826/**
@@ -1822,10 +1835,10 @@ static void __exit exit_sd(void)
1822 SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n")); 1835 SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));
1823 1836
1824 scsi_unregister_driver(&sd_template.gendrv); 1837 scsi_unregister_driver(&sd_template.gendrv);
1838 class_unregister(&sd_disk_class);
1839
1825 for (i = 0; i < SD_MAJORS; i++) 1840 for (i = 0; i < SD_MAJORS; i++)
1826 unregister_blkdev(sd_major(i), "sd"); 1841 unregister_blkdev(sd_major(i), "sd");
1827
1828 class_unregister(&sd_disk_class);
1829} 1842}
1830 1843
1831module_init(init_sd); 1844module_init(init_sd);