From 6e6156f614da0df8078a8f453c8a2e23cbb9338f Mon Sep 17 00:00:00 2001 From: Sergio Paracuellos Date: Tue, 3 Apr 2018 17:12:59 +0200 Subject: [PATCH] staging: ks7010: factor out initial enqueue process into ks7010_sme_enqueue_events This commit extract initial enqueue process into a new ks7010_sme_enqueue_events function. Signed-off-by: Sergio Paracuellos Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks7010_sdio.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 9af79ac..9907c0c 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -730,21 +730,8 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card) return ret; } -static void ks7010_card_init(struct ks_wlan_private *priv) +static void ks7010_sme_enqueue_events(struct ks_wlan_private *priv) { - init_completion(&priv->confirm_wait); - - /* get mac address & firmware version */ - hostif_sme_enqueue(priv, SME_START); - - if (!wait_for_completion_interruptible_timeout - (&priv->confirm_wait, 5 * HZ)) { - netdev_dbg(priv->net_dev, "wait time out!! SME_START\n"); - } - - if (priv->mac_address_valid && priv->version_size != 0) - priv->dev_state = DEVICE_STATE_PREINIT; - hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM); /* load initial wireless parameter */ @@ -763,6 +750,24 @@ static void ks7010_card_init(struct ks_wlan_private *priv) hostif_sme_enqueue(priv, SME_RSN_ENABLED_REQUEST); hostif_sme_enqueue(priv, SME_MODE_SET_REQUEST); hostif_sme_enqueue(priv, SME_START_REQUEST); +} + +static void ks7010_card_init(struct ks_wlan_private *priv) +{ + init_completion(&priv->confirm_wait); + + /* get mac address & firmware version */ + hostif_sme_enqueue(priv, SME_START); + + if (!wait_for_completion_interruptible_timeout + (&priv->confirm_wait, 5 * HZ)) { + netdev_dbg(priv->net_dev, "wait time out!! SME_START\n"); + } + + if (priv->mac_address_valid && priv->version_size != 0) + priv->dev_state = DEVICE_STATE_PREINIT; + + ks7010_sme_enqueue_events(priv); if (!wait_for_completion_interruptible_timeout (&priv->confirm_wait, 5 * HZ)) { -- 2.7.4