summaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fc.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-07-02 10:56:37 +0200
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-12 15:22:35 +0200
commit317e6b6519b5a34263a33f150ed57ad468b26a64 (patch)
tree074a35c260d567911b009fd70b83940cdd254bbd /drivers/s390/scsi/zfcp_fc.c
parent[SCSI] zfcp: Cleanup of code in zfcp_scsi.c (diff)
downloadlinux-317e6b6519b5a34263a33f150ed57ad468b26a64.tar.xz
linux-317e6b6519b5a34263a33f150ed57ad468b26a64.zip
[SCSI] zfcp: Cleanup of code in zfcp_aux.c
Overall cleanup of zfcp_aux.c to simplify code and follow kernel coding style. 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_fc.c')
-rw-r--r--drivers/s390/scsi/zfcp_fc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index 5d9367d9a12d..fbe2c76df4d7 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -39,6 +39,18 @@ struct zfcp_gpn_ft {
struct scatterlist sg_resp[ZFCP_GPN_FT_BUFFERS];
};
+static struct zfcp_port *zfcp_get_port_by_did(struct zfcp_adapter *adapter,
+ u32 d_id)
+{
+ struct zfcp_port *port;
+
+ list_for_each_entry(port, &adapter->port_list_head, list)
+ if ((port->d_id == d_id) &&
+ !atomic_test_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status))
+ return port;
+ return NULL;
+}
+
static void _zfcp_fc_incoming_rscn(struct zfcp_fsf_req *fsf_req, u32 range,
struct fcp_rscn_element *elem)
{
@@ -496,10 +508,10 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft)
port = zfcp_port_enqueue(adapter, acc->wwpn,
ZFCP_STATUS_PORT_DID_DID |
ZFCP_STATUS_COMMON_NOESC, d_id);
- if (port)
- zfcp_erp_port_reopen(port, 0, 149, NULL);
+ if (IS_ERR(port))
+ ret = PTR_ERR(port);
else
- ret = -ENOMEM;
+ zfcp_erp_port_reopen(port, 0, 149, NULL);
if (acc->control & 0x80) /* last entry */
break;
}