diff options
author | Robert Love <robert.w.love@intel.com> | 2013-03-25 14:00:28 -0400 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2013-03-25 19:03:03 -0400 |
commit | 0807619d3c64d935c257a377ac86982c777f969c (patch) | |
tree | 694bc549a00c1128ba304c362504ed5c73848ed5 /drivers/scsi/libfc/fc_disc.c | |
parent | 8a9a71381208b2364a2d12b0d257ae333917a1bc (diff) |
libfc, fcoe, bnx2fc: Split fc_disc_init into fc_disc_{init, config}
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>
Diffstat (limited to 'drivers/scsi/libfc/fc_disc.c')
-rw-r--r-- | drivers/scsi/libfc/fc_disc.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 141c54b97082..880a9068ca12 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c | |||
@@ -712,13 +712,13 @@ static void fc_disc_stop_final(struct fc_lport *lport) | |||
712 | } | 712 | } |
713 | 713 | ||
714 | /** | 714 | /** |
715 | * fc_disc_init() - Initialize the discovery layer for a local port | 715 | * fc_disc_config() - Configure the discovery layer for a local port |
716 | * @lport: The local port that needs the discovery layer to be initialized | 716 | * @lport: The local port that needs the discovery layer to be configured |
717 | * @priv: Private data structre for users of the discovery layer | 717 | * @priv: Private data structre for users of the discovery layer |
718 | */ | 718 | */ |
719 | int fc_disc_init(struct fc_lport *lport, void *priv) | 719 | void fc_disc_config(struct fc_lport *lport, void *priv) |
720 | { | 720 | { |
721 | struct fc_disc *disc; | 721 | struct fc_disc *disc = &lport->disc; |
722 | 722 | ||
723 | if (!lport->tt.disc_start) | 723 | if (!lport->tt.disc_start) |
724 | lport->tt.disc_start = fc_disc_start; | 724 | lport->tt.disc_start = fc_disc_start; |
@@ -733,12 +733,21 @@ int fc_disc_init(struct fc_lport *lport, void *priv) | |||
733 | lport->tt.disc_recv_req = fc_disc_recv_req; | 733 | lport->tt.disc_recv_req = fc_disc_recv_req; |
734 | 734 | ||
735 | disc = &lport->disc; | 735 | disc = &lport->disc; |
736 | INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout); | ||
737 | mutex_init(&disc->disc_mutex); | ||
738 | INIT_LIST_HEAD(&disc->rports); | ||
739 | 736 | ||
740 | disc->priv = priv; | 737 | disc->priv = priv; |
738 | } | ||
739 | EXPORT_SYMBOL(fc_disc_config); | ||
741 | 740 | ||
742 | return 0; | 741 | /** |
742 | * fc_disc_init() - Initialize the discovery layer for a local port | ||
743 | * @lport: The local port that needs the discovery layer to be initialized | ||
744 | */ | ||
745 | void fc_disc_init(struct fc_lport *lport) | ||
746 | { | ||
747 | struct fc_disc *disc = &lport->disc; | ||
748 | |||
749 | INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout); | ||
750 | mutex_init(&disc->disc_mutex); | ||
751 | INIT_LIST_HEAD(&disc->rports); | ||
743 | } | 752 | } |
744 | EXPORT_SYMBOL(fc_disc_init); | 753 | EXPORT_SYMBOL(fc_disc_init); |