]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
libfc, fcoe, bnx2fc: Split fc_disc_init into fc_disc_{init, config}
authorRobert Love <robert.w.love@intel.com>
Mon, 25 Mar 2013 18:00:28 +0000 (11:00 -0700)
committerRobert Love <robert.w.love@intel.com>
Mon, 25 Mar 2013 23:03:03 +0000 (16:03 -0700)
Split discovery initialization in code that is setup once (fcoe_disc_init)
and code that can be re-configured (fcoe_disc_config).

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Jack Morgan <jack.morgan@intel.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/libfc/fc_disc.c
include/scsi/libfc.h

index b867b1bfa908d906df35a038b7e1f8acf9c6f628..90bc7bd00966e9a87845bee59c1976a74d959fb3 100644 (file)
@@ -939,7 +939,8 @@ 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, lport);
+       fc_disc_init(lport);
+       fc_disc_config(lport, lport);
        return 0;
 }
 
index ba2f977a6e1db8a417d54a378e21ec740ff8d54b..34ee56cf4bcc938db57e758f56bc474cc8bbc244 100644 (file)
@@ -2847,7 +2847,8 @@ int fcoe_libfc_config(struct fc_lport *lport, struct fcoe_ctlr *fip,
                priv = fip;
        }
 
-       fc_disc_init(lport, priv);
+       fc_disc_init(lport);
+       fc_disc_config(lport, priv);
 
        return 0;
 }
index 141c54b970826ed5c53a11b2911ad88a7a7ff77e..880a9068ca1268baf851ea8804f3bdb4216049f6 100644 (file)
@@ -712,13 +712,13 @@ 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
+ * fc_disc_config() - Configure the discovery layer for a local port
+ * @lport: The local port that needs the discovery layer to be configured
  * @priv: Private data structre for users of the discovery layer
  */
-int fc_disc_init(struct fc_lport *lport, void *priv)
+void fc_disc_config(struct fc_lport *lport, void *priv)
 {
-       struct fc_disc *disc;
+       struct fc_disc *disc = &lport->disc;
 
        if (!lport->tt.disc_start)
                lport->tt.disc_start = fc_disc_start;
@@ -733,12 +733,21 @@ int fc_disc_init(struct fc_lport *lport, void *priv)
                lport->tt.disc_recv_req = fc_disc_recv_req;
 
        disc = &lport->disc;
-       INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);
-       mutex_init(&disc->disc_mutex);
-       INIT_LIST_HEAD(&disc->rports);
 
        disc->priv = priv;
+}
+EXPORT_SYMBOL(fc_disc_config);
 
-       return 0;
+/**
+ * fc_disc_init() - Initialize the discovery layer for a local port
+ * @lport: The local port that needs the discovery layer to be initialized
+ */
+void fc_disc_init(struct fc_lport *lport)
+{
+       struct fc_disc *disc = &lport->disc;
+
+       INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);
+       mutex_init(&disc->disc_mutex);
+       INIT_LIST_HEAD(&disc->rports);
 }
 EXPORT_SYMBOL(fc_disc_init);
index add2a498bd44fcdf1d1faddb6e585d4f2ba9268a..e1379b4e8faf569c6f95131577bba6c4c392e2b0 100644 (file)
@@ -1074,7 +1074,8 @@ void fc_rport_terminate_io(struct fc_rport *);
 /*
  * DISCOVERY LAYER
  *****************************/
-int fc_disc_init(struct fc_lport *, void *);
+void fc_disc_init(struct fc_lport *);
+void fc_disc_config(struct fc_lport *, void *);
 
 static inline struct fc_lport *fc_disc_lport(struct fc_disc *disc)
 {