Commit eaa5f7be authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: simplified if conditions in spi_data_write()

Cleanup patch to simplify the if conditions logic in spi_data_write().
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 73a75364
...@@ -617,28 +617,23 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz) ...@@ -617,28 +617,23 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
*/ */
ix = 0; ix = 0;
do { do {
if (sz <= DATA_PKT_SZ) if (sz <= DATA_PKT_SZ) {
nbytes = sz; nbytes = sz;
else order = 0x3;
} else {
nbytes = DATA_PKT_SZ; nbytes = DATA_PKT_SZ;
if (ix == 0)
order = 0x1;
else
order = 0x02;
}
/* /*
* Write command * Write command
*/ */
cmd = 0xf0; cmd = 0xf0;
if (ix == 0) {
if (sz <= DATA_PKT_SZ)
order = 0x3;
else
order = 0x1;
} else {
if (sz <= DATA_PKT_SZ)
order = 0x3;
else
order = 0x2;
}
cmd |= order; cmd |= order;
if (wilc_spi_tx(wilc, &cmd, 1)) { if (wilc_spi_tx(wilc, &cmd, 1)) {
dev_err(&spi->dev, dev_err(&spi->dev,
"Failed data block cmd write, bus error...\n"); "Failed data block cmd write, bus error...\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment