summaryrefslogtreecommitdiff
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-10-18 10:01:44 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2016-11-08 17:29:55 -0500
commitc96c792aee33ab1a06c4d595959cd92eddbdbf3e (patch)
tree6a9369a3379db96e741264928635b346a565d847 /drivers/scsi/libfc
parent05d7d3b0bd07e3990ab7a39ee93be28dbf7091d4 (diff)
scsi: libfc: Replace ->rport_logoff callback with function call
The ->rport_logoff callback only ever had one implementation, so we can as well call it directly and drop the callback. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Reviewed-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_disc.c8
-rw-r--r--drivers/scsi/libfc/fc_lport.c10
-rw-r--r--drivers/scsi/libfc/fc_rport.c8
3 files changed, 12 insertions, 14 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 8d0aa19b1f5b..7efa5a66e92a 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -71,7 +71,7 @@ static void fc_disc_stop_rports(struct fc_disc *disc)
rcu_read_lock();
list_for_each_entry_rcu(rdata, &disc->rports, peers) {
if (kref_get_unless_zero(&rdata->kref)) {
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
}
}
@@ -301,7 +301,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
if (rdata->disc_id == disc->disc_id)
fc_rport_login(rdata);
else
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
}
kref_put(&rdata->kref, fc_rport_destroy);
}
@@ -622,7 +622,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
"Port-id %6.6x wwpn %16.16llx\n",
rdata->ids.port_id, port_name);
mutex_unlock(&rdata->rp_mutex);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
mutex_lock(&lport->disc.disc_mutex);
new_rdata = fc_rport_create(lport, rdata->ids.port_id);
mutex_unlock(&lport->disc.disc_mutex);
@@ -638,7 +638,7 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
} else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
FC_DISC_DBG(disc, "GPN_ID rejected reason %x exp %x\n",
cp->ct_reason, cp->ct_explan);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
} else {
FC_DISC_DBG(disc, "GPN_ID unexpected response code %x\n",
ntohs(cp->ct_cmd));
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
index e20c1519be15..a391cb160f4b 100644
--- a/drivers/scsi/libfc/fc_lport.c
+++ b/drivers/scsi/libfc/fc_lport.c
@@ -200,7 +200,7 @@ static void fc_lport_rport_callback(struct fc_lport *lport,
"in the DNS or FDMI state, it's in the "
"%d state", rdata->ids.port_id,
lport->state);
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
}
break;
case RPORT_EV_LOGO:
@@ -246,7 +246,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
u64 remote_wwnn)
{
if (lport->ptp_rdata) {
- lport->tt.rport_logoff(lport->ptp_rdata);
+ fc_rport_logoff(lport->ptp_rdata);
kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
}
mutex_lock(&lport->disc.disc_mutex);
@@ -623,7 +623,7 @@ int fc_fabric_logoff(struct fc_lport *lport)
lport->tt.disc_stop_final(lport);
mutex_lock(&lport->lp_mutex);
if (lport->dns_rdata)
- lport->tt.rport_logoff(lport->dns_rdata);
+ fc_rport_logoff(lport->dns_rdata);
mutex_unlock(&lport->lp_mutex);
lport->tt.rport_flush_queue();
mutex_lock(&lport->lp_mutex);
@@ -1011,12 +1011,12 @@ EXPORT_SYMBOL(fc_lport_reset);
static void fc_lport_reset_locked(struct fc_lport *lport)
{
if (lport->dns_rdata) {
- lport->tt.rport_logoff(lport->dns_rdata);
+ fc_rport_logoff(lport->dns_rdata);
lport->dns_rdata = NULL;
}
if (lport->ptp_rdata) {
- lport->tt.rport_logoff(lport->ptp_rdata);
+ fc_rport_logoff(lport->ptp_rdata);
kref_put(&lport->ptp_rdata->kref, fc_rport_destroy);
lport->ptp_rdata = NULL;
}
diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c
index c045bc459910..22c8c928ee2b 100644
--- a/drivers/scsi/libfc/fc_rport.c
+++ b/drivers/scsi/libfc/fc_rport.c
@@ -295,7 +295,7 @@ static void fc_rport_work(struct work_struct *work)
}
if (!rport) {
FC_RPORT_DBG(rdata, "Failed to add the rport\n");
- lport->tt.rport_logoff(rdata);
+ fc_rport_logoff(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
return;
}
@@ -504,7 +504,7 @@ static void fc_rport_enter_delete(struct fc_rport_priv *rdata,
* function will hold the rport lock, call an _enter_*
* function and then unlock the rport.
*/
-static int fc_rport_logoff(struct fc_rport_priv *rdata)
+int fc_rport_logoff(struct fc_rport_priv *rdata)
{
struct fc_lport *lport = rdata->local_port;
u32 port_id = rdata->ids.port_id;
@@ -538,6 +538,7 @@ out:
mutex_unlock(&rdata->rp_mutex);
return 0;
}
+EXPORT_SYMBOL(fc_rport_logoff);
/**
* fc_rport_enter_ready() - Transition to the RPORT_ST_READY state
@@ -2184,9 +2185,6 @@ static void fc_rport_flush_queue(void)
*/
int fc_rport_init(struct fc_lport *lport)
{
- if (!lport->tt.rport_logoff)
- lport->tt.rport_logoff = fc_rport_logoff;
-
if (!lport->tt.rport_recv_req)
lport->tt.rport_recv_req = fc_rport_recv_req;