From patchwork Mon Dec 21 05:18:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7893091 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04F9ABEEE5 for ; Mon, 21 Dec 2015 05:15:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28884202E9 for ; Mon, 21 Dec 2015 05:15:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25123202B8 for ; Mon, 21 Dec 2015 05:15:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751076AbbLUFPl (ORCPT ); Mon, 21 Dec 2015 00:15:41 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:11228 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751058AbbLUFPk (ORCPT ); Mon, 21 Dec 2015 00:15:40 -0500 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Mon, 21 Dec 2015 06:15:37 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH RESEND 06/46] staging: wilc1000: remove io_type of wilc_wlan_dev_t Date: Mon, 21 Dec 2015 14:18:10 +0900 Message-ID: <1450675130-17866-7-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450675130-17866-1-git-send-email-glen.lee@atmel.com> References: <1450675130-17866-1-git-send-email-glen.lee@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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, ®); 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, ®); 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, ®); 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, ®); 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_;