mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
staging: r8188eu: convert rtw_writeN() to common error logic
Convert the function rtw_writeN() away from returning _FAIL or _SUCCESS which uses inverted error logic. Use the common error logic instead. Return 0 for success and negative values for failure. Signed-off-by: Michael Straube <straube.linux@gmail.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Link: https://lore.kernel.org/r/20230108123804.3754-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5877852e9f
commit
1d0d77f4ec
|
|
@ -89,9 +89,8 @@ static int block_write(struct adapter *padapter, u8 *buffer, u32 size)
|
|||
addr = FW_8188E_START_ADDRESS + i * block_size;
|
||||
data = buffer + i * block_size;
|
||||
|
||||
ret = rtw_writeN(padapter, addr, block_size, data);
|
||||
if (ret == _FAIL)
|
||||
goto exit;
|
||||
if (rtw_writeN(padapter, addr, block_size, data))
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if (remain) {
|
||||
|
|
@ -105,9 +104,8 @@ static int block_write(struct adapter *padapter, u8 *buffer, u32 size)
|
|||
addr = FW_8188E_START_ADDRESS + offset + i * block_size;
|
||||
data = buffer + offset + i * block_size;
|
||||
|
||||
ret = rtw_writeN(padapter, addr, block_size, data);
|
||||
if (ret == _FAIL)
|
||||
goto exit;
|
||||
if (rtw_writeN(padapter, addr, block_size, data))
|
||||
return _FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,14 +179,11 @@ int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
|
|||
struct io_priv *io_priv = &adapter->iopriv;
|
||||
struct intf_hdl *intf = &io_priv->intf;
|
||||
u16 value = addr & 0xffff;
|
||||
int ret;
|
||||
|
||||
if (length > VENDOR_CMD_MAX_DATA_LEN)
|
||||
return _FAIL;
|
||||
return -EINVAL;
|
||||
|
||||
ret = usb_write(intf, value, data, length);
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
return usb_write(intf, value, data, length);
|
||||
}
|
||||
|
||||
static void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user