Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213339
b: refs/heads/master
c: 9b90677
h: refs/heads/master
i:
  213337: 8434371
  213335: a09a4a0
v: v3
  • Loading branch information
Nicholas Bellinger authored and James Bottomley committed Sep 17, 2010
1 parent c80bcae commit 2b1c104
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 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: 78d16341facf829a71b6f7c68ec5511b9c168060
refs/heads/master: 9b906779568f009b53254a15b283b53ae4570b93
25 changes: 8 additions & 17 deletions trunk/drivers/scsi/scsi_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -3226,16 +3226,7 @@ static void do_remove_driverfs_files(void)
driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host);
}

static void pseudo_0_release(struct device *dev)
{
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
}

static struct device pseudo_primary = {
.init_name = "pseudo_0",
.release = pseudo_0_release,
};
struct device *pseudo_primary;

static int __init scsi_debug_init(void)
{
Expand Down Expand Up @@ -3382,10 +3373,10 @@ static int __init scsi_debug_init(void)
map_region(0, 2);
}

ret = device_register(&pseudo_primary);
if (ret < 0) {
printk(KERN_WARNING "scsi_debug: device_register error: %d\n",
ret);
pseudo_primary = root_device_register("pseudo_0");
if (IS_ERR(pseudo_primary)) {
printk(KERN_WARNING "scsi_debug: root_device_register() error\n");
ret = PTR_ERR(pseudo_primary);
goto free_vm;
}
ret = bus_register(&pseudo_lld_bus);
Expand Down Expand Up @@ -3432,7 +3423,7 @@ static int __init scsi_debug_init(void)
bus_unreg:
bus_unregister(&pseudo_lld_bus);
dev_unreg:
device_unregister(&pseudo_primary);
root_device_unregister(pseudo_primary);
free_vm:
if (map_storep)
vfree(map_storep);
Expand All @@ -3453,7 +3444,7 @@ static void __exit scsi_debug_exit(void)
do_remove_driverfs_files();
driver_unregister(&sdebug_driverfs_driver);
bus_unregister(&pseudo_lld_bus);
device_unregister(&pseudo_primary);
root_device_unregister(pseudo_primary);

if (dif_storep)
vfree(dif_storep);
Expand Down Expand Up @@ -3504,7 +3495,7 @@ static int sdebug_add_adapter(void)
spin_unlock(&sdebug_host_list_lock);

sdbg_host->dev.bus = &pseudo_lld_bus;
sdbg_host->dev.parent = &pseudo_primary;
sdbg_host->dev.parent = pseudo_primary;
sdbg_host->dev.release = &sdebug_release_adapter;
dev_set_name(&sdbg_host->dev, "adapter%d", scsi_debug_add_host);

Expand Down

0 comments on commit 2b1c104

Please sign in to comment.