summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/wilc_wlan.c
diff options
context:
space:
mode:
authorArnd Bergmann2015-11-16 15:04:59 +0100
committerGreg Kroah-Hartman2015-12-18 23:19:20 +0100
commit4bd7baf04de9ce5f8117da30d5ee2368f3c41b3e (patch)
tree3190efa4ee16cfe1f424b1a74393b35e4360f9ba /drivers/staging/wilc1000/wilc_wlan.c
parentstaging/wilc1000: remove linux_wlan_{device_power,device_detection} (diff)
downloadkernel-qcow2-linux-4bd7baf04de9ce5f8117da30d5ee2368f3c41b3e.tar.gz
kernel-qcow2-linux-4bd7baf04de9ce5f8117da30d5ee2368f3c41b3e.tar.xz
kernel-qcow2-linux-4bd7baf04de9ce5f8117da30d5ee2368f3c41b3e.zip
staging/wilc1000: move wilc_wlan_inp_t into struct wilc
wilc_wlan_inp_t is an unnecessary indirection and requires linux_wlan.c to have knowledge of the specific sdio and spi front-ends. This removes the structure and places io_type directly inside the struct wilc. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_wlan.c')
-rw-r--r--drivers/staging/wilc1000/wilc_wlan.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index f7359f79ff8d..2958689a13c6 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -5,7 +5,7 @@
typedef struct {
int quit;
- wilc_wlan_io_func_t io_func;
+ int io_type;
struct wilc_hif_func hif_func;
int cfg_frame_in_use;
struct wilc_cfg_frame cfg_frame;
@@ -576,7 +576,7 @@ static inline void chip_wakeup(void)
u32 reg, clk_status_reg, trials = 0;
u32 sleep_time;
- if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
+ if ((g_wlan.io_type & 0x1) == HIF_SPI) {
do {
g_wlan.hif_func.hif_read_reg(1, &reg);
g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
@@ -590,7 +590,7 @@ static inline void chip_wakeup(void)
} while ((wilc_get_chipid(true) == 0) && ((++trials % 3) == 0));
} while (wilc_get_chipid(true) == 0);
- } else if ((g_wlan.io_func.io_type & 0x1) == HIF_SDIO) {
+ } else if ((g_wlan.io_type & 0x1) == HIF_SDIO) {
g_wlan.hif_func.hif_read_reg(0xf0, &reg);
do {
g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
@@ -636,12 +636,12 @@ static inline void chip_wakeup(void)
u32 reg, trials = 0;
do {
- if ((g_wlan.io_func.io_type & 0x1) == HIF_SPI) {
+ if ((g_wlan.io_type & 0x1) == HIF_SPI) {
g_wlan.hif_func.hif_read_reg(1, &reg);
g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
g_wlan.hif_func.hif_write_reg(1, reg | BIT(1));
g_wlan.hif_func.hif_write_reg(1, reg & ~BIT(1));
- } else if ((g_wlan.io_func.io_type & 0x1) == HIF_SDIO) {
+ } else if ((g_wlan.io_type & 0x1) == HIF_SDIO) {
g_wlan.hif_func.hif_read_reg(0xf0, &reg);
g_wlan.hif_func.hif_write_reg(0xf0, reg & ~BIT(0));
g_wlan.hif_func.hif_write_reg(0xf0, reg | BIT(0));
@@ -1252,10 +1252,10 @@ int wilc_wlan_start(void)
int ret;
u32 chipid;
- if (p->io_func.io_type == HIF_SDIO) {
+ if (p->io_type == HIF_SDIO) {
reg = 0;
reg |= BIT(3);
- } else if (p->io_func.io_type == HIF_SPI) {
+ } else if (p->io_type == HIF_SPI) {
reg = 1;
}
acquire_bus(ACQUIRE_ONLY);
@@ -1649,7 +1649,7 @@ _fail_:
return chipid;
}
-int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
+int wilc_wlan_init(struct net_device *dev)
{
int ret = 0;
perInterface_wlan_t *nic = netdev_priv(dev);
@@ -1660,8 +1660,7 @@ int wilc_wlan_init(struct net_device *dev, wilc_wlan_inp_t *inp)
PRINT_D(INIT_DBG, "Initializing WILC_Wlan ...\n");
memset((void *)&g_wlan, 0, sizeof(wilc_wlan_dev_t));
- memcpy((void *)&g_wlan.io_func, (void *)&inp->io_func,
- sizeof(wilc_wlan_io_func_t));
+ g_wlan.io_type = wilc->io_type;
#ifdef WILC_SDIO
if (!wilc_hif_sdio.hif_init(wilc, wilc_debug)) {