aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:19 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:53 -0400
commita1b449de5d35b9eec8981c6ea999eea263b19a0b (patch)
tree7503d041e1439e08cefc729c28e656e48843966e /drivers/s390/scsi
parent7ba58c9cc16d296290fe645acb11db2b01276544 (diff)
[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')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c13
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c17
-rw-r--r--drivers/s390/scsi/zfcp_ext.h1
3 files changed, 18 insertions, 13 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 811ce8a2825..6397de01b85 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -106,19 +106,6 @@ static int __init zfcp_device_setup(char *devstr)
106 return 0; 106 return 0;
107} 107}
108 108
109static struct zfcp_adapter *zfcp_get_adapter_by_busid(char *bus_id)
110{
111 struct zfcp_adapter *adapter;
112
113 list_for_each_entry(adapter, &zfcp_data.adapter_list_head, list)
114 if ((strncmp(bus_id, adapter->ccw_device->dev.bus_id,
115 BUS_ID_SIZE) == 0) &&
116 !(atomic_read(&adapter->status) &
117 ZFCP_STATUS_COMMON_REMOVE))
118 return adapter;
119 return NULL;
120}
121
122static void __init zfcp_init_device_configure(void) 109static void __init zfcp_init_device_configure(void)
123{ 110{
124 struct zfcp_adapter *adapter; 111 struct zfcp_adapter *adapter;
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 0e1a42f7a4b..3a9bd5451a4 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)
224{ 224{
225 return ccw_driver_register(&zfcp_ccw_driver); 225 return ccw_driver_register(&zfcp_ccw_driver);
226} 226}
227
228/**
229 * zfcp_get_adapter_by_busid - find zfcp_adapter struct
230 * @busid: bus id string of zfcp adapter to find
231 */
232struct zfcp_adapter *zfcp_get_adapter_by_busid(char *busid)
233{
234 struct ccw_device *ccw_device;
235 struct zfcp_adapter *adapter = NULL;
236
237 ccw_device = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
238 if (ccw_device) {
239 adapter = dev_get_drvdata(&ccw_device->dev);
240 put_device(&ccw_device->dev);
241 }
242 return adapter;
243}
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index ca1db974fc5..b8c5c37b2af 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -27,6 +27,7 @@ extern int zfcp_sg_setup_table(struct scatterlist *, int);
27 27
28/* zfcp_ccw.c */ 28/* zfcp_ccw.c */
29extern int zfcp_ccw_register(void); 29extern int zfcp_ccw_register(void);
30extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *);
30 31
31/* zfcp_cfdc.c */ 32/* zfcp_cfdc.c */
32extern struct miscdevice zfcp_cfdc_misc; 33extern struct miscdevice zfcp_cfdc_misc;