From: Glen Lee Date: Wed, 18 Nov 2015 06:11:28 +0000 (+0900) Subject: staging: wilc1000: wilc_sdio_cmd53: pass struct wilc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b410fe82f444e473f1f13b3476f5aecdff50610;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: wilc1000: wilc_sdio_cmd53: pass struct wilc This patch adds new function parameter struct wilc and use it instead of global variable wilc_dev and pass wilc to the function as well. Signed-off-by: Glen Lee Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.c b/drivers/staging/wilc1000/linux_wlan_sdio.c index 6a38876ab2df..92633aa2c0bb 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.c +++ b/drivers/staging/wilc1000/linux_wlan_sdio.c @@ -61,9 +61,9 @@ int wilc_sdio_cmd52(struct wilc *wilc, sdio_cmd52_t *cmd) } -int wilc_sdio_cmd53(sdio_cmd53_t *cmd) +int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd) { - struct sdio_func *func = container_of(wilc_dev->dev, struct sdio_func, dev); + struct sdio_func *func = container_of(wilc->dev, struct sdio_func, dev); int size, ret; sdio_claim_host(func); diff --git a/drivers/staging/wilc1000/linux_wlan_sdio.h b/drivers/staging/wilc1000/linux_wlan_sdio.h index d966bb96d269..8d276c61cdcc 100644 --- a/drivers/staging/wilc1000/linux_wlan_sdio.h +++ b/drivers/staging/wilc1000/linux_wlan_sdio.h @@ -2,7 +2,7 @@ int wilc_sdio_init(void); int wilc_sdio_cmd52(struct wilc *wilc, sdio_cmd52_t *cmd); -int wilc_sdio_cmd53(sdio_cmd53_t *cmd); +int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd); int wilc_sdio_enable_interrupt(struct wilc *); void wilc_sdio_disable_interrupt(struct wilc *); diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 6e53ea001ee5..ff7990a0b5ec 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -197,7 +197,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data) cmd.buffer = (u8 *)&data; cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */ - if (!wilc_sdio_cmd53(&cmd)) { + if (!wilc_sdio_cmd53(wilc, &cmd)) { g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53, write reg (%08x)...\n", addr); goto _fail_; } @@ -260,7 +260,7 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(&cmd)) { + if (!wilc_sdio_cmd53(wilc, &cmd)) { g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block send...\n", addr); goto _fail_; } @@ -281,7 +281,7 @@ static int sdio_write(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(&cmd)) { + if (!wilc_sdio_cmd53(wilc, &cmd)) { g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], bytes send...\n", addr); goto _fail_; } @@ -324,7 +324,7 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data) cmd.block_size = g_sdio.block_size; /* johnny : prevent it from setting unexpected value */ - if (!wilc_sdio_cmd53(&cmd)) { + if (!wilc_sdio_cmd53(wilc, &cmd)) { g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53, read reg (%08x)...\n", addr); goto _fail_; } @@ -391,7 +391,7 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(&cmd)) { + if (!wilc_sdio_cmd53(wilc, &cmd)) { g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block read...\n", addr); goto _fail_; } @@ -412,7 +412,7 @@ static int sdio_read(struct wilc *wilc, u32 addr, u8 *buf, u32 size) if (!sdio_set_func0_csa_address(wilc, addr)) goto _fail_; } - if (!wilc_sdio_cmd53(&cmd)) { + if (!wilc_sdio_cmd53(wilc, &cmd)) { g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], bytes read...\n", addr); goto _fail_; }