Commit 34f1e874 authored by James Bottomley's avatar James Bottomley

Merge by hand hch driverfs changes and hch sd cleanup

parents bd24aecd 07152268
...@@ -541,9 +541,6 @@ static inline void scsi_set_pci_device(struct Scsi_Host *shost, ...@@ -541,9 +541,6 @@ static inline void scsi_set_pci_device(struct Scsi_Host *shost,
{ {
shost->pci_dev = pdev; shost->pci_dev = pdev;
shost->host_driverfs_dev.parent=&pdev->dev; shost->host_driverfs_dev.parent=&pdev->dev;
/* register parent with driverfs */
device_register(&shost->host_driverfs_dev);
} }
......
...@@ -1996,6 +1996,11 @@ int scsi_register_device(struct Scsi_Device_Template *tpnt) ...@@ -1996,6 +1996,11 @@ int scsi_register_device(struct Scsi_Device_Template *tpnt)
tpnt->next = scsi_devicelist; tpnt->next = scsi_devicelist;
scsi_devicelist = tpnt; scsi_devicelist = tpnt;
tpnt->scsi_driverfs_driver.name = (char *)tpnt->tag;
tpnt->scsi_driverfs_driver.bus = &scsi_driverfs_bus_type;
driver_register(&tpnt->scsi_driverfs_driver);
/* /*
* First scan the devices that we know about, and see if we notice them. * First scan the devices that we know about, and see if we notice them.
*/ */
...@@ -2067,6 +2072,8 @@ int scsi_unregister_device(struct Scsi_Device_Template *tpnt) ...@@ -2067,6 +2072,8 @@ int scsi_unregister_device(struct Scsi_Device_Template *tpnt)
if (GET_USE_COUNT(tpnt->module) != 0) if (GET_USE_COUNT(tpnt->module) != 0)
goto error_out; goto error_out;
driver_unregister(&tpnt->scsi_driverfs_driver);
/* /*
* Next, detach the devices from the driver. * Next, detach the devices from the driver.
*/ */
......
...@@ -1334,7 +1334,6 @@ static int __init init_sd(void) ...@@ -1334,7 +1334,6 @@ static int __init init_sd(void)
SD_MAJOR(i)); SD_MAJOR(i));
else else
majors++; majors++;
}
if (!majors) if (!majors)
return -ENODEV; return -ENODEV;
...@@ -1342,9 +1341,6 @@ static int __init init_sd(void) ...@@ -1342,9 +1341,6 @@ static int __init init_sd(void)
rc = scsi_register_device(&sd_template); rc = scsi_register_device(&sd_template);
if (rc) if (rc)
return rc; return rc;
sd_template.scsi_driverfs_driver.name = (char *)sd_template.tag;
sd_template.scsi_driverfs_driver.bus = &scsi_driverfs_bus_type;
driver_register(&sd_template.scsi_driverfs_driver);
register_reboot_notifier(&sd_notifier_block); register_reboot_notifier(&sd_notifier_block);
return rc; return rc;
} }
......
...@@ -1629,17 +1629,9 @@ MODULE_PARM_DESC(def_reserved_size, "size of buffer reserved for each fd"); ...@@ -1629,17 +1629,9 @@ MODULE_PARM_DESC(def_reserved_size, "size of buffer reserved for each fd");
static int __init static int __init
init_sg(void) init_sg(void)
{ {
int rc;
if (def_reserved_size >= 0) if (def_reserved_size >= 0)
sg_big_buff = def_reserved_size; sg_big_buff = def_reserved_size;
rc = scsi_register_device(&sg_template); return scsi_register_device(&sg_template);
if (!rc) {
sg_template.scsi_driverfs_driver.name =
(char *) sg_template.tag;
sg_template.scsi_driverfs_driver.bus = &scsi_driverfs_bus_type;
driver_register(&sg_template.scsi_driverfs_driver);
}
return rc;
} }
static void __exit static void __exit
...@@ -1655,7 +1647,6 @@ exit_sg(void) ...@@ -1655,7 +1647,6 @@ exit_sg(void)
sg_dev_arr = NULL; sg_dev_arr = NULL;
} }
sg_template.dev_max = 0; sg_template.dev_max = 0;
driver_unregister(&sg_template.scsi_driverfs_driver);
} }
static int static int
......
...@@ -838,14 +838,7 @@ static void sr_detach(struct scsi_device * SDp) ...@@ -838,14 +838,7 @@ static void sr_detach(struct scsi_device * SDp)
static int __init init_sr(void) static int __init init_sr(void)
{ {
int rc; return scsi_register_device(&sr_template);
rc = scsi_register_device(&sr_template);
if (!rc) {
sr_template.scsi_driverfs_driver.name = (char *)sr_template.tag;
sr_template.scsi_driverfs_driver.bus = &scsi_driverfs_bus_type;
driver_register(&sr_template.scsi_driverfs_driver);
}
return rc;
} }
static void __exit exit_sr(void) static void __exit exit_sr(void)
...@@ -857,7 +850,6 @@ static void __exit exit_sr(void) ...@@ -857,7 +850,6 @@ static void __exit exit_sr(void)
kfree(scsi_CDs); kfree(scsi_CDs);
sr_template.dev_max = 0; sr_template.dev_max = 0;
driver_unregister(&sr_template.scsi_driverfs_driver);
} }
module_init(init_sr); module_init(init_sr);
......
...@@ -3965,14 +3965,8 @@ static int __init init_st(void) ...@@ -3965,14 +3965,8 @@ static int __init init_st(void)
st_max_sg_segs); st_max_sg_segs);
if (register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) { if (register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) {
if (scsi_register_device(&st_template) == 0) { if (scsi_register_device(&st_template) == 0)
st_template.scsi_driverfs_driver.name =
(char *)st_template.tag;
st_template.scsi_driverfs_driver.bus =
&scsi_driverfs_bus_type;
driver_register(&st_template.scsi_driverfs_driver);
return 0; return 0;
}
} }
printk(KERN_ERR "Unable to get major %d for SCSI tapes\n", MAJOR_NR); printk(KERN_ERR "Unable to get major %d for SCSI tapes\n", MAJOR_NR);
...@@ -3992,7 +3986,6 @@ static void __exit exit_st(void) ...@@ -3992,7 +3986,6 @@ static void __exit exit_st(void)
kfree(scsi_tapes); kfree(scsi_tapes);
} }
st_template.dev_max = 0; st_template.dev_max = 0;
driver_unregister(&st_template.scsi_driverfs_driver);
printk(KERN_INFO "st: Unloaded.\n"); printk(KERN_INFO "st: Unloaded.\n");
} }
......
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