All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glen Lee <glen.lee@atmel.com>
To: <gregkh@linuxfoundation.org>
Cc: <devel@driverdev.osuosl.org>, <linux-wireless@vger.kernel.org>,
	<tony.cho@atmel.com>, <glen.lee@atmel.com>, <leo.kim@atmel.com>,
	<austin.shin@atmel.com>, <adel.noureldin@atmel.com>,
	<adham.abozaeid@atmel.com>, <Nicolas.FERRE@atmel.com>
Subject: [PATCH 11/12] staging: wilc1000: set hif_drv before it is used
Date: Mon, 14 Dec 2015 14:47:02 +0900	[thread overview]
Message-ID: <1450072023-13013-12-git-send-email-glen.lee@atmel.com> (raw)
In-Reply-To: <1450072023-13013-1-git-send-email-glen.lee@atmel.com>

We are using hif_drv of vif, so it needs to be set before it is used.
Set hif_drv to vif->hifdrv soon after it is allocated.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 ++++++
 drivers/staging/wilc1000/linux_wlan.c     | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index f97ea49..0125e3d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3775,6 +3775,7 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 	struct host_if_drv *hif_drv;
 	struct wilc_vif *vif;
 	struct wilc *wilc;
+	int i;
 
 	vif = netdev_priv(dev);
 	wilc = vif->wilc;
@@ -3791,6 +3792,11 @@ s32 wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 		goto _fail_;
 	}
 	*hif_drv_handler = hif_drv;
+	for (i = 0; i < wilc->vif_num; i++)
+		if (dev == wilc->vif[i]->ndev) {
+			wilc->vif[i]->hif_drv = hif_drv;
+			break;
+		}
 
 	wilc_optaining_ip = false;
 
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index a50e3ff..54fe9d7 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1036,7 +1036,6 @@ int wilc_mac_open(struct net_device *ndev)
 	for (i = 0; i < wl->vif_num; i++) {
 		if (ndev == wl->vif[i]->ndev) {
 			memcpy(wl->vif[i]->src_addr, mac_add, ETH_ALEN);
-			wl->vif[i]->hif_drv = priv->hWILCWFIDrv;
 			break;
 		}
 	}
-- 
1.9.1


  parent reply	other threads:[~2015-12-14  5:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14  5:46 [PATCH 00/12] Use index of interface to communicate with wilc device Glen Lee
2015-12-14  5:46 ` [PATCH 01/12] staging: wilc1000: pass vif to hostIFthread Glen Lee
2015-12-18 22:44   ` Greg KH
2015-12-14  5:46 ` [PATCH 02/12] staging: wilc1000: remove argument hif_drv Glen Lee
2015-12-14  5:46 ` [PATCH 03/12] staging: wilc1000: take vif instead of drv in hostIFthread Glen Lee
2015-12-14  5:46 ` [PATCH 04/12] staging: wilc1000: pass struct wilc Glen Lee
2015-12-14  5:46 ` [PATCH 05/12] staging: wilc1000: use vif index to communicate with wilc device Glen Lee
2015-12-14  5:46 ` [PATCH 06/12] staging: wilc1000: wilc_set_wfi_drv_handler: pass vif index Glen Lee
2015-12-14  5:46 ` [PATCH 07/12] staging: wilc1000: change join_req_drv type and it's name Glen Lee
2015-12-14  5:46 ` [PATCH 08/12] staging: wilc1000: remove used functions Glen Lee
2015-12-14  5:47 ` [PATCH 09/12] staging: wilc1000: remove drv of struct host_if_msg Glen Lee
2015-12-14  5:47 ` [PATCH 10/12] staging: wilc1000: remove wilc of struct host_if_drv Glen Lee
2015-12-14  5:47 ` Glen Lee [this message]
2015-12-14  5:47 ` [PATCH 12/12] staging: wilc1000: bug fix on memory free Glen Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450072023-13013-12-git-send-email-glen.lee@atmel.com \
    --to=glen.lee@atmel.com \
    --cc=Nicolas.FERRE@atmel.com \
    --cc=adel.noureldin@atmel.com \
    --cc=adham.abozaeid@atmel.com \
    --cc=austin.shin@atmel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=leo.kim@atmel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tony.cho@atmel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.