aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2008-03-18 09:32:28 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-22 16:16:29 -0400
commitb0ed43360fdca227048d88a08290365cb681c1a8 (patch)
treec4bec4f311c2d73159df6fe35986442968aae8c9 /drivers/scsi/scsi_scan.c
parentcb6b7f40630f94126233194847a86bf5501fb63c (diff)
[SCSI] add scsi_host and scsi_target to scsi_bus
This patch implements scsi_host and scsi_target device types and adds both to the scsi_bus. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index e67c14e31bab..e1644b270cdc 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -331,9 +331,14 @@ static void scsi_target_dev_release(struct device *dev)
331 put_device(parent); 331 put_device(parent);
332} 332}
333 333
334struct device_type scsi_target_type = {
335 .name = "scsi_target",
336 .release = scsi_target_dev_release,
337};
338
334int scsi_is_target_device(const struct device *dev) 339int scsi_is_target_device(const struct device *dev)
335{ 340{
336 return dev->release == scsi_target_dev_release; 341 return dev->type == &scsi_target_type;
337} 342}
338EXPORT_SYMBOL(scsi_is_target_device); 343EXPORT_SYMBOL(scsi_is_target_device);
339 344
@@ -391,9 +396,12 @@ static struct scsi_target *scsi_alloc_target(struct device *parent,
391 device_initialize(dev); 396 device_initialize(dev);
392 starget->reap_ref = 1; 397 starget->reap_ref = 1;
393 dev->parent = get_device(parent); 398 dev->parent = get_device(parent);
394 dev->release = scsi_target_dev_release;
395 sprintf(dev->bus_id, "target%d:%d:%d", 399 sprintf(dev->bus_id, "target%d:%d:%d",
396 shost->host_no, channel, id); 400 shost->host_no, channel, id);
401#ifndef CONFIG_SYSFS_DEPRECATED
402 dev->bus = &scsi_bus_type;
403#endif
404 dev->type = &scsi_target_type;
397 starget->id = id; 405 starget->id = id;
398 starget->channel = channel; 406 starget->channel = channel;
399 INIT_LIST_HEAD(&starget->siblings); 407 INIT_LIST_HEAD(&starget->siblings);