linux-wireless.vger.kernel.org archive mirror
 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 4/6] staging: wilc1000: remove io_type of wilc_wlan_dev_t
Date: Fri, 20 Nov 2015 16:56:34 +0900	[thread overview]
Message-ID: <1448006196-28555-4-git-send-email-glen.lee@atmel.com> (raw)
In-Reply-To: <1448006196-28555-1-git-send-email-glen.lee@atmel.com>

io_type of wilc_wlan_dev_t is unneeded, we can use io_type of struct wilc.
Remove io_type of wilc_wlan_dev_t and use io_type of wilc.

Signed-off-by: Glen Lee <glen.lee@atmel.com>
---
 drivers/staging/wilc1000/wilc_wlan.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index b9bedc8..37879cd 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -5,7 +5,6 @@
 
 typedef struct {
 	int quit;
-	int io_type;
 	int cfg_frame_in_use;
 	struct wilc_cfg_frame cfg_frame;
 	u32 cfg_frame_offset;
@@ -573,7 +572,7 @@ static inline void chip_wakeup(struct wilc *wilc)
 	u32 reg, clk_status_reg, trials = 0;
 	u32 sleep_time;
 
-	if ((g_wlan.io_type & 0x1) == HIF_SPI) {
+	if ((wilc->io_type & 0x1) == HIF_SPI) {
 		do {
 			wilc->hif_func->hif_read_reg(wilc, 1, &reg);
 			wilc->hif_func->hif_write_reg(wilc, 1, reg | BIT(1));
@@ -587,7 +586,7 @@ static inline void chip_wakeup(struct wilc *wilc)
 			} while ((wilc_get_chipid(wilc, true) == 0) && ((++trials % 3) == 0));
 
 		} while (wilc_get_chipid(wilc, true) == 0);
-	} else if ((g_wlan.io_type & 0x1) == HIF_SDIO)	 {
+	} else if ((wilc->io_type & 0x1) == HIF_SDIO)	 {
 		wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 		do {
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
@@ -636,12 +635,12 @@ static inline void chip_wakeup(struct wilc *wilc)
 	u32 reg, trials = 0;
 
 	do {
-		if ((g_wlan.io_type & 0x1) == HIF_SPI) {
+		if ((wilc->io_type & 0x1) == HIF_SPI) {
 			wilc->hif_func->hif_read_reg(wilc, 1, &reg);
 			wilc->hif_func->hif_write_reg(wilc, 1, reg & ~BIT(1));
 			wilc->hif_func->hif_write_reg(wilc, 1, reg | BIT(1));
 			wilc->hif_func->hif_write_reg(wilc, 1, reg  & ~BIT(1));
-		} else if ((g_wlan.io_type & 0x1) == HIF_SDIO)	 {
+		} else if ((wilc->io_type & 0x1) == HIF_SDIO)	 {
 			wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
 						      reg & ~BIT(0));
@@ -1061,7 +1060,7 @@ static void wilc_pllupdate_isr_ext(struct wilc *wilc, u32 int_stats)
 
 	wilc->hif_func->hif_clear_int_ext(wilc, PLL_INT_CLR);
 
-	if (g_wlan.io_type == HIF_SDIO)
+	if (wilc->io_type == HIF_SDIO)
 		mdelay(WILC_PLL_TO_SDIO);
 	else
 		mdelay(WILC_PLL_TO_SPI);
@@ -1225,15 +1224,14 @@ _fail_1:
 
 int wilc_wlan_start(struct wilc *wilc)
 {
-	wilc_wlan_dev_t *p = &g_wlan;
 	u32 reg = 0;
 	int ret;
 	u32 chipid;
 
-	if (p->io_type == HIF_SDIO) {
+	if (wilc->io_type == HIF_SDIO) {
 		reg = 0;
 		reg |= BIT(3);
-	} else if (p->io_type == HIF_SPI) {
+	} else if (wilc->io_type == HIF_SPI) {
 		reg = 1;
 	}
 	acquire_bus(wilc, ACQUIRE_ONLY);
@@ -1245,7 +1243,7 @@ int wilc_wlan_start(struct wilc *wilc)
 		return ret;
 	}
 	reg = 0;
-	if (p->io_type == HIF_SDIO && wilc->dev_irq_num)
+	if (wilc->io_type == HIF_SDIO && wilc->dev_irq_num)
 		reg |= WILC_HAVE_SDIO_IRQ_GPIO;
 
 #ifdef WILC_DISABLE_PMU
@@ -1627,7 +1625,6 @@ int wilc_wlan_init(struct net_device *dev)
 	PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n");
 
 	memset((void *)&g_wlan, 0, sizeof(wilc_wlan_dev_t));
-	g_wlan.io_type = wilc->io_type;
 	if (!wilc->hif_func->hif_init(wilc, wilc_debug)) {
 		ret = -EIO;
 		goto _fail_;
-- 
1.9.1


  parent reply	other threads:[~2015-11-20  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  7:56 [PATCH 1/6] staging: wilc1000: remove unused variable Glen Lee
2015-11-20  7:56 ` [PATCH 2/6] staging: wilc1000: return linux error value Glen Lee
2015-11-20  7:56 ` [PATCH 3/6] staging: wilc1000: wilc_wlan.c: remove hif_func of wilc_wlan_dev_t Glen Lee
2015-12-18 22:37   ` Greg KH
2015-11-20  7:56 ` Glen Lee [this message]
2015-11-20  7:56 ` [PATCH 5/6] staging: wilc1000: remove unused varialbe tx_buffer_offset Glen Lee
2015-11-20  7:56 ` [PATCH 6/6] staging: wilc1000: move all of wilc_wlan_dev_t to struct wilc 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=1448006196-28555-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).