dev_err(&spi->dev,
"FAILED due to NULL buffer or ZERO length check the following length: %d\n",
len);
- ret = -1;
+ ret = -EINVAL;
}
- /* change return value to match WILC interface */
- (ret < 0) ? (ret = 0) : (ret = 1);
-
-
return ret;
}
dev_err(&spi->dev,
"can't read data with the following length: %u\n",
rlen);
- ret = -1;
+ ret = -EINVAL;
}
- /* change return value to match WILC interface */
- (ret < 0) ? (ret = 0) : (ret = 1);
return ret;
}
dev_err(&spi->dev,
"can't read data with the following length: %u\n",
rlen);
- ret = -1;
+ ret = -EINVAL;
}
- /* change return value to match WILC interface */
- (ret < 0) ? (ret = 0) : (ret = 1);
return ret;
}
}
rix = len;
- if (!wilc_spi_write_read(wilc, wb, rb, len2)) {
+ if (wilc_spi_write_read(wilc, wb, rb, len2)) {
dev_err(&spi->dev, "Failed cmd write, bus error...\n");
result = N_FAIL;
return result;
/**
* Read bytes
**/
- if (!wilc_spi_read(wilc, &b[ix], nbytes)) {
+ if (wilc_spi_read(wilc, &b[ix], nbytes)) {
dev_err(&spi->dev, "Failed data block read, bus error...\n");
result = N_FAIL;
goto _error_;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!wilc_spi_read(wilc, crc, 2)) {
+ if (wilc_spi_read(wilc, crc, 2)) {
dev_err(&spi->dev, "Failed data block crc read, bus error...\n");
result = N_FAIL;
goto _error_;
**/
retry = 10;
do {
- if (!wilc_spi_read(wilc, &rsp, 1)) {
+ if (wilc_spi_read(wilc, &rsp, 1)) {
dev_err(&spi->dev, "Failed data response read, bus error...\n");
result = N_FAIL;
break;
/**
* Read bytes
**/
- if (!wilc_spi_read(wilc, &b[ix], nbytes)) {
+ if (wilc_spi_read(wilc, &b[ix], nbytes)) {
dev_err(&spi->dev, "Failed data block read, bus error...\n");
result = N_FAIL;
break;
* Read Crc
**/
if (!g_spi.crc_off) {
- if (!wilc_spi_read(wilc, crc, 2)) {
+ if (wilc_spi_read(wilc, crc, 2)) {
dev_err(&spi->dev, "Failed data block crc read, bus error...\n");
result = N_FAIL;
break;
order = 0x2;
}
cmd |= order;
- if (!wilc_spi_write(wilc, &cmd, 1)) {
+ if (wilc_spi_write(wilc, &cmd, 1)) {
dev_err(&spi->dev,
"Failed data block cmd write, bus error...\n");
result = N_FAIL;
/**
* Write data
**/
- if (!wilc_spi_write(wilc, &b[ix], nbytes)) {
+ if (wilc_spi_write(wilc, &b[ix], nbytes)) {
dev_err(&spi->dev,
"Failed data block write, bus error...\n");
result = N_FAIL;
* Write Crc
**/
if (!g_spi.crc_off) {
- if (!wilc_spi_write(wilc, crc, 2)) {
+ if (wilc_spi_write(wilc, crc, 2)) {
dev_err(&spi->dev,"Failed data block crc write, bus error...\n");
result = N_FAIL;
break;