staging: wilc1000: linux_wlan_spi: correct types
authorStanislav Kholmanskikh <kholmanskikh.s.s@gmail.com>
Thu, 8 Oct 2015 18:23:13 +0000 (21:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 03:59:18 +0000 (20:59 -0700)
linux_spi_write(), linux_spi_read(), linux_spi_write_read():

    nwi->io_func.u.spi.spi_tx = linux_spi_write;
    nwi->io_func.u.spi.spi_rx = linux_spi_read;
    nwi->io_func.u.spi.spi_trx = linux_spi_write_read;

are expected to accept arguments of 'u8 *', u32 types:

    struct {
        int (*spi_max_speed)(void);
        int (*spi_tx)(u8 *, u32);
        int (*spi_rx)(u8 *, u32);
        int (*spi_trx)(u8 *, u8 *, u32);
    } spi;

However, linux_spi_read() and linux_spi_write_read() do not do this,
they use 'unsigned char *' and 'unsigned long' instead.

Changed the types of their arguments to satisfy the expectations.

Signed-off-by: Stanislav Kholmanskikh <kholmanskikh.s.s@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan_spi.c
drivers/staging/wilc1000/linux_wlan_spi.h

index 51bbd969e96ba377fb0fc32e3b67f46f2ca4c80f..c6c1f6ec8c7187faf2445b63c8edf3cef3567cbb 100644 (file)
@@ -243,7 +243,7 @@ int linux_spi_write(u8 *b, u32 len)
 
 #if defined(TXRX_PHASE_SIZE)
 
-int linux_spi_read(unsigned char *rb, unsigned long rlen)
+int linux_spi_read(u8 *rb, u32 rlen)
 {
        int ret;
 
@@ -307,7 +307,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
 
                kfree(t_buffer);
        } else {
-               PRINT_ER("can't read data with the following length: %ld\n", rlen);
+               PRINT_ER("can't read data with the following length: %u\n", rlen);
                ret = -1;
        }
        /* change return value to match WILC interface */
@@ -317,7 +317,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
 }
 
 #else
-int linux_spi_read(unsigned char *rb, unsigned long rlen)
+int linux_spi_read(u8 *rb, u32 rlen)
 {
 
        int ret;
@@ -351,7 +351,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
                }
                kfree(t_buffer);
        } else {
-               PRINT_ER("can't read data with the following length: %ld\n", rlen);
+               PRINT_ER("can't read data with the following length: %u\n", rlen);
                ret = -1;
        }
        /* change return value to match WILC interface */
@@ -362,7 +362,7 @@ int linux_spi_read(unsigned char *rb, unsigned long rlen)
 
 #endif
 
-int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen)
+int linux_spi_write_read(u8 *wb, u8 *rb, u32 rlen)
 {
 
        int ret;
@@ -390,7 +390,7 @@ int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen
                        PRINT_ER("SPI transaction failed\n");
                }
        } else {
-               PRINT_ER("can't read data with the following length: %d\n", rlen);
+               PRINT_ER("can't read data with the following length: %u\n", rlen);
                ret = -1;
        }
        /* change return value to match WILC interface */
index d8eed0f52f8b5ca0ed799ed81d095fc0039cae42..7356785296f9fff8c5fa12c35b9c9d96088edde0 100644 (file)
@@ -9,6 +9,6 @@ int linux_spi_init(void *vp);
 void linux_spi_deinit(void *vp);
 int linux_spi_write(u8 *b, u32 len);
 int linux_spi_read(u8 *rb, u32 rlen);
-int linux_spi_write_read(unsigned char *wb, unsigned char *rb, unsigned int rlen);
+int linux_spi_write_read(u8 *wb, u8 *rb, u32 rlen);
 int linux_spi_set_max_speed(void);
 #endif