Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8719
b: refs/heads/master
c: 903f4fe
h: refs/heads/master
i:
  8717: 6ef6d83
  8715: 0100e90
  8711: 2c2207c
  8703: c1fcf53
v: v3
  • Loading branch information
Alan Stern authored and James Bottomley committed Sep 9, 2005
1 parent b10efe4 commit 56821ae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 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: e517d3133f62c27b211f305a6dbd6f6ccac0db1b
refs/heads/master: 903f4fed858a7b56b260cbd55d174fe54d188fb7
1 change: 1 addition & 0 deletions trunk/drivers/scsi/scsi_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ extern void scsi_sysfs_unregister(void);
extern void scsi_sysfs_device_initialize(struct scsi_device *);
extern int scsi_sysfs_target_initialize(struct scsi_device *);
extern struct scsi_transport_template blank_transport_template;
extern void __scsi_remove_device(struct scsi_device *);

extern struct bus_type scsi_bus_type;

Expand Down
28 changes: 15 additions & 13 deletions trunk/drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
error = attr_add(&sdev->sdev_gendev,
sdev->host->hostt->sdev_attrs[i]);
if (error) {
scsi_remove_device(sdev);
__scsi_remove_device(sdev);
goto out;
}
}
Expand All @@ -667,7 +667,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
scsi_sysfs_sdev_attrs[i]);
error = device_create_file(&sdev->sdev_gendev, attr);
if (error) {
scsi_remove_device(sdev);
__scsi_remove_device(sdev);
goto out;
}
}
Expand All @@ -687,17 +687,10 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
return error;
}

/**
* scsi_remove_device - unregister a device from the scsi bus
* @sdev: scsi_device to unregister
**/
void scsi_remove_device(struct scsi_device *sdev)
void __scsi_remove_device(struct scsi_device *sdev)
{
struct Scsi_Host *shost = sdev->host;

down(&shost->scan_mutex);
if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0)
goto out;
return;

class_device_unregister(&sdev->sdev_classdev);
device_del(&sdev->sdev_gendev);
Expand All @@ -706,8 +699,17 @@ void scsi_remove_device(struct scsi_device *sdev)
sdev->host->hostt->slave_destroy(sdev);
transport_unregister_device(&sdev->sdev_gendev);
put_device(&sdev->sdev_gendev);
out:
up(&shost->scan_mutex);
}

/**
* scsi_remove_device - unregister a device from the scsi bus
* @sdev: scsi_device to unregister
**/
void scsi_remove_device(struct scsi_device *sdev)
{
down(&sdev->host->scan_mutex);
__scsi_remove_device(sdev);
up(&sdev->host->scan_mutex);
}
EXPORT_SYMBOL(scsi_remove_device);

Expand Down

0 comments on commit 56821ae

Please sign in to comment.