This patch (as1339) simplifies __scsi_remove_target() by replacing target-reap operations with calls to get_device()/put_device(). Since the target is being removed entirely, there's no need to prevent it from being removed from visibility. Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> --- Index: usb-2.6/drivers/scsi/scsi_sysfs.c =================================================================== --- usb-2.6.orig/drivers/scsi/scsi_sysfs.c +++ usb-2.6/drivers/scsi/scsi_sysfs.c @@ -986,8 +986,8 @@ static void __scsi_remove_target(struct unsigned long flags; struct scsi_device *sdev; + get_device(&starget->dev); spin_lock_irqsave(shost->host_lock, flags); - starget->reap_ref++; restart: list_for_each_entry(sdev, &shost->__devices, siblings) { if (sdev->channel != starget->channel || @@ -1000,7 +1000,7 @@ static void __scsi_remove_target(struct goto restart; } spin_unlock_irqrestore(shost->host_lock, flags); - scsi_target_reap(starget); + put_device(&starget->dev); } static int __remove_child (struct device * dev, void * data) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html