diff options
author | Hannes Reinecke <hare@suse.de> | 2008-03-18 09:32:28 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-22 16:16:29 -0400 |
commit | b0ed43360fdca227048d88a08290365cb681c1a8 (patch) | |
tree | c4bec4f311c2d73159df6fe35986442968aae8c9 /drivers/scsi/hosts.c | |
parent | cb6b7f40630f94126233194847a86bf5501fb63c (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/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index c264a8c5f01e..63bed62f270e 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -284,6 +284,11 @@ static void scsi_host_dev_release(struct device *dev) | |||
284 | kfree(shost); | 284 | kfree(shost); |
285 | } | 285 | } |
286 | 286 | ||
287 | struct device_type scsi_host_type = { | ||
288 | .name = "scsi_host", | ||
289 | .release = scsi_host_dev_release, | ||
290 | }; | ||
291 | |||
287 | /** | 292 | /** |
288 | * scsi_host_alloc - register a scsi host adapter instance. | 293 | * scsi_host_alloc - register a scsi host adapter instance. |
289 | * @sht: pointer to scsi host template | 294 | * @sht: pointer to scsi host template |
@@ -383,7 +388,10 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) | |||
383 | device_initialize(&shost->shost_gendev); | 388 | device_initialize(&shost->shost_gendev); |
384 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", | 389 | snprintf(shost->shost_gendev.bus_id, BUS_ID_SIZE, "host%d", |
385 | shost->host_no); | 390 | shost->host_no); |
386 | shost->shost_gendev.release = scsi_host_dev_release; | 391 | #ifndef CONFIG_SYSFS_DEPRECATED |
392 | shost->shost_gendev.bus = &scsi_bus_type; | ||
393 | #endif | ||
394 | shost->shost_gendev.type = &scsi_host_type; | ||
387 | 395 | ||
388 | device_initialize(&shost->shost_dev); | 396 | device_initialize(&shost->shost_dev); |
389 | shost->shost_dev.parent = &shost->shost_gendev; | 397 | shost->shost_dev.parent = &shost->shost_gendev; |
@@ -496,7 +504,7 @@ void scsi_exit_hosts(void) | |||
496 | 504 | ||
497 | int scsi_is_host_device(const struct device *dev) | 505 | int scsi_is_host_device(const struct device *dev) |
498 | { | 506 | { |
499 | return dev->release == scsi_host_dev_release; | 507 | return dev->type == &scsi_host_type; |
500 | } | 508 | } |
501 | EXPORT_SYMBOL(scsi_is_host_device); | 509 | EXPORT_SYMBOL(scsi_is_host_device); |
502 | 510 | ||