Commit b34f5571 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[PATCH] fixes an ide-scsi oops in 2.6-test5

The attached patch cleans up the ide-scsi driver model code and fixes
the oops described below which is caused when doing a rmmod on the
driver.
parent e35b6d40
...@@ -946,13 +946,6 @@ static Scsi_Host_Template idescsi_template = { ...@@ -946,13 +946,6 @@ static Scsi_Host_Template idescsi_template = {
.proc_name = "ide-scsi", .proc_name = "ide-scsi",
}; };
static struct device idescsi_primary = {
.bus_id = "ide-scsi",
};
static struct bus_type idescsi_emu_bus = {
.name = "ide-scsi",
};
static int idescsi_attach(ide_drive_t *drive) static int idescsi_attach(ide_drive_t *drive)
{ {
idescsi_scsi_t *idescsi; idescsi_scsi_t *idescsi;
...@@ -975,7 +968,7 @@ static int idescsi_attach(ide_drive_t *drive) ...@@ -975,7 +968,7 @@ static int idescsi_attach(ide_drive_t *drive)
if (!err) { if (!err) {
idescsi_setup (drive, idescsi); idescsi_setup (drive, idescsi);
drive->disk->fops = &idescsi_ops; drive->disk->fops = &idescsi_ops;
err = scsi_add_host(host, &idescsi_primary); err = scsi_add_host(host, &drive->gendev);
if (!err) { if (!err) {
scsi_scan_host(host); scsi_scan_host(host);
return 0; return 0;
...@@ -990,27 +983,11 @@ static int idescsi_attach(ide_drive_t *drive) ...@@ -990,27 +983,11 @@ static int idescsi_attach(ide_drive_t *drive)
static int __init init_idescsi_module(void) static int __init init_idescsi_module(void)
{ {
int err; return ide_register_driver(&idescsi_driver);
err = bus_register(&idescsi_emu_bus);
if (!err) {
err = device_register(&idescsi_primary);
if (!err) {
err = ide_register_driver(&idescsi_driver);
if (!err)
return 0;
device_unregister(&idescsi_primary);
}
bus_unregister(&idescsi_emu_bus);
}
return err;
} }
static void __exit exit_idescsi_module(void) static void __exit exit_idescsi_module(void)
{ {
device_unregister(&idescsi_primary);
bus_unregister (&idescsi_emu_bus);
ide_unregister_driver(&idescsi_driver); ide_unregister_driver(&idescsi_driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment