diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-07-09 16:34:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-07-09 16:34:25 -0400 |
commit | f974a8ec96571535ee07880a023bcce0e3f2c76b (patch) | |
tree | 5cf09207b1ad292a55275cd0b24999fa29b9dfe8 /drivers/scsi/hosts.c | |
parent | c0b8556f2f8146bd38324b14b1ce00f249ba8ed9 (diff) | |
parent | 4ed47896935573c8423d05bddda3f269d6e6c613 (diff) |
Merge branch 'machtypes' into pxa-palm
Diffstat (limited to 'drivers/scsi/hosts.c')
-rw-r--r-- | drivers/scsi/hosts.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 3690360d7a79..c6457bfc8a49 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -456,6 +456,10 @@ static int __scsi_host_match(struct device *dev, void *data) | |||
456 | * | 456 | * |
457 | * Return value: | 457 | * Return value: |
458 | * A pointer to located Scsi_Host or NULL. | 458 | * A pointer to located Scsi_Host or NULL. |
459 | * | ||
460 | * The caller must do a scsi_host_put() to drop the reference | ||
461 | * that scsi_host_get() took. The put_device() below dropped | ||
462 | * the reference from class_find_device(). | ||
459 | **/ | 463 | **/ |
460 | struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | 464 | struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) |
461 | { | 465 | { |
@@ -463,9 +467,10 @@ struct Scsi_Host *scsi_host_lookup(unsigned short hostnum) | |||
463 | struct Scsi_Host *shost = ERR_PTR(-ENXIO); | 467 | struct Scsi_Host *shost = ERR_PTR(-ENXIO); |
464 | 468 | ||
465 | cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match); | 469 | cdev = class_find_device(&shost_class, &hostnum, __scsi_host_match); |
466 | if (cdev) | 470 | if (cdev) { |
467 | shost = scsi_host_get(class_to_shost(cdev)); | 471 | shost = scsi_host_get(class_to_shost(cdev)); |
468 | 472 | put_device(cdev); | |
473 | } | ||
469 | return shost; | 474 | return shost; |
470 | } | 475 | } |
471 | EXPORT_SYMBOL(scsi_host_lookup); | 476 | EXPORT_SYMBOL(scsi_host_lookup); |