Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2360
b: refs/heads/master
c: 20b1e67
h: refs/heads/master
v: v3
  • Loading branch information
mochel@digitalimplant.org authored and Greg Kroah-Hartman committed Jun 20, 2005
1 parent 6fd751d commit d5f28a6
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 0293a509405dccecc30783a5d729d615b68d6a77
refs/heads/master: 20b1e674230b642be662c5975923a0160ab9cbdc
14 changes: 9 additions & 5 deletions trunk/drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,13 @@ void __scsi_remove_target(struct scsi_target *starget)
scsi_target_reap(starget);
}

static int __remove_child (struct device * dev, void * data)
{
if (scsi_is_target_device(dev))
__scsi_remove_target(to_scsi_target(dev));
return 0;
}

/**
* scsi_remove_target - try to remove a target and all its devices
* @dev: generic starget or parent of generic stargets to be removed
Expand All @@ -679,18 +686,15 @@ void __scsi_remove_target(struct scsi_target *starget)
*/
void scsi_remove_target(struct device *dev)
{
struct device *rdev, *idev, *next;
struct device *rdev;

if (scsi_is_target_device(dev)) {
__scsi_remove_target(to_scsi_target(dev));
return;
}

rdev = get_device(dev);
list_for_each_entry_safe(idev, next, &dev->children, node) {
if (scsi_is_target_device(idev))
__scsi_remove_target(to_scsi_target(idev));
}
device_for_each_child(dev, NULL, __remove_child);
put_device(rdev);
}
EXPORT_SYMBOL(scsi_remove_target);
Expand Down

0 comments on commit d5f28a6

Please sign in to comment.