summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c2
-rw-r--r--drivers/scsi/fcoe/fcoe_ctlr.c11
-rw-r--r--drivers/scsi/libfc/fc_disc.c5
3 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index cc4791c..b867b1b 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -939,7 +939,7 @@ static int bnx2fc_libfc_config(struct fc_lport *lport)
fc_elsct_init(lport);
fc_exch_init(lport);
fc_rport_init(lport);
- fc_disc_init(lport);
+ fc_disc_init(lport, lport);
return 0;
}
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 08c3bc3..ba2f977 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -2826,6 +2826,8 @@ unlock:
int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
const struct libfc_function_template *tt, int init_fcp)
{
+ void *priv = lport;
+
/* Set the function pointers set by the LLDD */
memcpy(&lport->tt, tt, sizeof(*tt));
if (init_fcp && fc_fcp_init(lport))
@@ -2842,12 +2844,11 @@ int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
lport->tt.disc_start = fcoe_ctlr_disc_start;
lport->tt.disc_stop = fcoe_ctlr_disc_stop;
lport->tt.disc_stop_final = fcoe_ctlr_disc_stop_final;
- mutex_init(&lport->disc.disc_mutex);
- INIT_LIST_HEAD(&lport->disc.rports);
- lport->disc.priv = fip;
- } else {
- fc_disc_init(lport);
+ priv = fip;
}
+
+ fc_disc_init(lport, priv);
+
return 0;
}
EXPORT_SYMBOL_GPL(fcoe_libfc_config);
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 8e561e6..141c54b 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -714,8 +714,9 @@ static void fc_disc_stop_final(struct fc_lport *lport)
/**
* fc_disc_init() - Initialize the discovery layer for a local port
* @lport: The local port that needs the discovery layer to be initialized
+ * @priv: Private data structre for users of the discovery layer
*/
-int fc_disc_init(struct fc_lport *lport)
+int fc_disc_init(struct fc_lport *lport, void *priv)
{
struct fc_disc *disc;
@@ -736,7 +737,7 @@ int fc_disc_init(struct fc_lport *lport)
mutex_init(&disc->disc_mutex);
INIT_LIST_HEAD(&disc->rports);
- disc->priv = lport;
+ disc->priv = priv;
return 0;
}