return ret;
}
-int wilc_spi_read(u8 *rb, u32 rlen)
+int wilc_spi_read(struct wilc *wilc, 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(u8 *rb, u32 rlen);
+int wilc_spi_read(struct wilc *wilc, u8 *rb, u32 rlen);
int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen);
#endif
/**
* Read bytes
**/
- if (!wilc_spi_read(&b[ix], nbytes)) {
+ if (!wilc_spi_read(wilc, &b[ix], nbytes)) {
PRINT_ER("[wilc spi]: Failed data block read, bus error...\n");
result = N_FAIL;
goto _error_;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!wilc_spi_read(crc, 2)) {
+ if (!wilc_spi_read(wilc, crc, 2)) {
PRINT_ER("[wilc spi]: Failed data block crc read, bus error...\n");
result = N_FAIL;
goto _error_;
**/
retry = 10;
do {
- if (!wilc_spi_read(&rsp, 1)) {
+ if (!wilc_spi_read(wilc, &rsp, 1)) {
PRINT_ER("[wilc spi]: Failed data response read, bus error...\n");
result = N_FAIL;
break;
/**
* Read bytes
**/
- if (!wilc_spi_read(&b[ix], nbytes)) {
+ if (!wilc_spi_read(wilc, &b[ix], nbytes)) {
PRINT_ER("[wilc spi]: Failed data block read, bus error...\n");
result = N_FAIL;
break;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!wilc_spi_read(crc, 2)) {
+ if (!wilc_spi_read(wilc, crc, 2)) {
PRINT_ER("[wilc spi]: Failed data block crc read, bus error...\n");
result = N_FAIL;
break;