Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38980
b: refs/heads/master
c: 5e4009b
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Garzik authored and James Bottomley committed Oct 4, 2006
1 parent 9ed0903 commit 461b470
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 37e0333c68ca9cbddfc0108e1889556287563df0
refs/heads/master: 5e4009ba3d5af40f5615fdb4304cc4a9947cca0a
23 changes: 18 additions & 5 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ static void sd_shutdown(struct device *dev)
**/
static int __init init_sd(void)
{
int majors = 0, i;
int majors = 0, i, err;

SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n"));

Expand All @@ -1806,9 +1806,22 @@ static int __init init_sd(void)
if (!majors)
return -ENODEV;

class_register(&sd_disk_class);
err = class_register(&sd_disk_class);
if (err)
goto err_out;

return scsi_register_driver(&sd_template.gendrv);
err = scsi_register_driver(&sd_template.gendrv);
if (err)
goto err_out_class;

return 0;

err_out_class:
class_unregister(&sd_disk_class);
err_out:
for (i = 0; i < SD_MAJORS; i++)
unregister_blkdev(sd_major(i), "sd");
return err;
}

/**
Expand All @@ -1823,10 +1836,10 @@ static void __exit exit_sd(void)
SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));

scsi_unregister_driver(&sd_template.gendrv);
class_unregister(&sd_disk_class);

for (i = 0; i < SD_MAJORS; i++)
unregister_blkdev(sd_major(i), "sd");

class_unregister(&sd_disk_class);
}

module_init(init_sd);
Expand Down

0 comments on commit 461b470

Please sign in to comment.