Commit 67039928 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging/wilc1000: pass io_type to wilc_netdev_init

In order to avoid some of the #ifdefs, this passes the io_type
and device pointer as an argument to wilc_netdev_init.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b03314e2
...@@ -25,11 +25,7 @@ ...@@ -25,11 +25,7 @@
#include <linux/semaphore.h> #include <linux/semaphore.h>
#ifdef WILC_SDIO
#include "linux_wlan_sdio.h" #include "linux_wlan_sdio.h"
#else
#include "linux_wlan_spi.h"
#endif
static int dev_state_ev_handler(struct notifier_block *this, unsigned long event, void *ptr); static int dev_state_ev_handler(struct notifier_block *this, unsigned long event, void *ptr);
...@@ -884,11 +880,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) ...@@ -884,11 +880,6 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
wlan_init_locks(dev); wlan_init_locks(dev);
#ifdef WILC_SDIO
wl->io_type = HIF_SDIO;
#else
wl->io_type = HIF_SPI;
#endif
ret = wilc_wlan_init(dev); ret = wilc_wlan_init(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Initializing WILC_Wlan FAILED\n"); PRINT_ER("Initializing WILC_Wlan FAILED\n");
...@@ -1426,7 +1417,7 @@ void wilc_netdev_cleanup(struct wilc *wilc) ...@@ -1426,7 +1417,7 @@ void wilc_netdev_cleanup(struct wilc *wilc)
#endif #endif
} }
int wilc_netdev_init(struct wilc **wilc) int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type)
{ {
int i; int i;
perInterface_wlan_t *nic; perInterface_wlan_t *nic;
...@@ -1439,7 +1430,7 @@ int wilc_netdev_init(struct wilc **wilc) ...@@ -1439,7 +1430,7 @@ int wilc_netdev_init(struct wilc **wilc)
return -ENOMEM; return -ENOMEM;
*wilc = wilc_dev; *wilc = wilc_dev;
wilc_dev->io_type = io_type;
register_inetaddr_notifier(&g_dev_notifier); register_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) { for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
...@@ -1468,9 +1459,8 @@ int wilc_netdev_init(struct wilc **wilc) ...@@ -1468,9 +1459,8 @@ int wilc_netdev_init(struct wilc **wilc)
struct wireless_dev *wdev; struct wireless_dev *wdev;
wdev = wilc_create_wiphy(ndev); wdev = wilc_create_wiphy(ndev);
#ifdef WILC_SDIO if (dev)
SET_NETDEV_DEV(ndev, &wilc_sdio_func->dev); SET_NETDEV_DEV(ndev, dev);
#endif
if (!wdev) { if (!wdev) {
PRINT_ER("Can't register WILC Wiphy\n"); PRINT_ER("Can't register WILC Wiphy\n");
......
#include "wilc_wfi_netdevice.h" #include "wilc_wfi_netdevice.h"
#include "linux_wlan_sdio.h"
#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h> #include <linux/mmc/card.h>
...@@ -113,7 +114,7 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id ...@@ -113,7 +114,7 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
PRINT_D(INIT_DBG, "Initializing netdev\n"); PRINT_D(INIT_DBG, "Initializing netdev\n");
wilc_sdio_func = func; wilc_sdio_func = func;
if (wilc_netdev_init(&wilc)) { if (wilc_netdev_init(&wilc, &func->dev, HIF_SDIO)) {
PRINT_ER("Couldn't initialize netdev\n"); PRINT_ER("Couldn't initialize netdev\n");
return -1; return -1;
} }
...@@ -215,7 +216,6 @@ int wilc_sdio_set_default_speed(void) ...@@ -215,7 +216,6 @@ int wilc_sdio_set_default_speed(void)
return linux_sdio_set_speed(sdio_default_speed); return linux_sdio_set_speed(sdio_default_speed);
} }
static int __init init_wilc_sdio_driver(void) static int __init init_wilc_sdio_driver(void)
{ {
return sdio_register_driver(&wilc_bus); return sdio_register_driver(&wilc_bus);
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include "linux_wlan_spi.h"
#include "wilc_wfi_netdevice.h" #include "wilc_wfi_netdevice.h"
#include "linux_wlan_common.h" #include "linux_wlan_common.h"
#include "linux_wlan_spi.h"
#include "wilc_wlan_if.h" #include "wilc_wlan_if.h"
#define USE_SPI_DMA 0 /* johnny add */ #define USE_SPI_DMA 0 /* johnny add */
...@@ -404,7 +404,7 @@ static int __init init_wilc_spi_driver(void) ...@@ -404,7 +404,7 @@ static int __init init_wilc_spi_driver(void)
wilc_debugfs_init(); wilc_debugfs_init();
ret = wilc_netdev_init(&wilc); ret = wilc_netdev_init(&wilc, NULL, HIF_SPI);
if (ret) { if (ret) {
wilc_debugfs_remove(); wilc_debugfs_remove();
return ret; return ret;
......
...@@ -213,7 +213,7 @@ void linux_wlan_rx_complete(void); ...@@ -213,7 +213,7 @@ void linux_wlan_rx_complete(void);
void linux_wlan_dbg(u8 *buff); void linux_wlan_dbg(u8 *buff);
int linux_wlan_lock_timeout(void *vp, u32 timeout); int linux_wlan_lock_timeout(void *vp, u32 timeout);
void wilc_netdev_cleanup(struct wilc *wilc); void wilc_netdev_cleanup(struct wilc *wilc);
int wilc_netdev_init(struct wilc **wilc); int wilc_netdev_init(struct wilc **wilc, struct device *, int io_type);
void wilc1000_wlan_deinit(struct net_device *dev); void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size); void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
u16 wilc_set_machw_change_vir_if(struct net_device *dev, bool value); u16 wilc_set_machw_change_vir_if(struct net_device *dev, bool value);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment