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>
        return ret;
 }
 
-int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen)
+int wilc_spi_write_read(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen)
 {
-       struct spi_device *spi = to_spi_device(wilc_dev->dev);
+       struct spi_device *spi = to_spi_device(wilc->dev);
        int ret;
 
        if (rlen > 0) {
 
 int wilc_spi_init(void);
 int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len);
 int wilc_spi_read(struct wilc *wilc, u8 *rb, u32 rlen);
-int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen);
+int wilc_spi_write_read(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen);
 #endif
 
        }
        rix = len;
 
-       if (!wilc_spi_write_read(wb, rb, len2)) {
+       if (!wilc_spi_write_read(wilc, wb, rb, len2)) {
                PRINT_ER("[wilc spi]: Failed cmd write, bus error...\n");
                result = N_FAIL;
                return result;