summaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_ccw.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 12:42:19 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 19:11:53 +0200
commita1b449de5d35b9eec8981c6ea999eea263b19a0b (patch)
tree7503d041e1439e08cefc729c28e656e48843966e /drivers/s390/scsi/zfcp_ccw.c
parent[SCSI] zfcp: remove all typedefs and replace them with standards (diff)
downloadlinux-a1b449de5d35b9eec8981c6ea999eea263b19a0b.tar.xz
linux-a1b449de5d35b9eec8981c6ea999eea263b19a0b.zip
[SCSI] zfcp: Simplify get_adapter_by_busid
Call the helper function from cio instead looping through all zfcp adapters. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_ccw.c')
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 0e1a42f7a4b5..3a9bd5451a49 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -224,3 +224,20 @@ int __init zfcp_ccw_register(void)
{
return ccw_driver_register(&zfcp_ccw_driver);
}
+
+/**
+ * zfcp_get_adapter_by_busid - find zfcp_adapter struct
+ * @busid: bus id string of zfcp adapter to find
+ */
+struct zfcp_adapter *zfcp_get_adapter_by_busid(char *busid)
+{
+ struct ccw_device *ccw_device;
+ struct zfcp_adapter *adapter = NULL;
+
+ ccw_device = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
+ if (ccw_device) {
+ adapter = dev_get_drvdata(&ccw_device->dev);
+ put_device(&ccw_device->dev);
+ }
+ return adapter;
+}