staging: wilc1000: wilc_sdio_cmd53: pass struct wilc
authorGlen Lee <glen.lee@atmel.com>
Wed, 18 Nov 2015 06:11:28 +0000 (15:11 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Dec 2015 22:30:50 +0000 (14:30 -0800)
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 <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan_sdio.c
drivers/staging/wilc1000/linux_wlan_sdio.h
drivers/staging/wilc1000/wilc_sdio.c

index 6a38876ab2dfd07232e9f4f6b898204a32d4bc3a..92633aa2c0bbef6451f1c04599fe5f7701a5eac8 100644 (file)
@@ -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);
index d966bb96d269098dd843013d1e6c080876e1c7b6..8d276c61cdcc8b644afd55161ceba7c37afb3645 100644 (file)
@@ -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 *);
index 6e53ea001ee5e42f0bad201d238416bb4364f839..ff7990a0b5ec9b80f40ab8ee0beb73491841b3dc 100644 (file)
@@ -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_;
                }