提交 5b2e2ecc 编写于 作者: B Bing Zhao 提交者: John W. Linville

mwifiex: do not overwrite error code from lower layer driver

Instead of converting it to a bogus error code -1, we should
return the original error code from lower layer driver. This
error code will be printed so it may give user some clues on
what has happened.
Signed-off-by: NBing Zhao <bzhao@marvell.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 3220712d
...@@ -332,7 +332,7 @@ mwifiex_write_data_sync(struct mwifiex_adapter *adapter, ...@@ -332,7 +332,7 @@ mwifiex_write_data_sync(struct mwifiex_adapter *adapter,
u8 *buffer, u32 pkt_len, u32 port) u8 *buffer, u32 pkt_len, u32 port)
{ {
struct sdio_mmc_card *card = adapter->card; struct sdio_mmc_card *card = adapter->card;
int ret = -1; int ret;
u8 blk_mode = u8 blk_mode =
(port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE; (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE;
u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1; u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1;
...@@ -350,8 +350,7 @@ mwifiex_write_data_sync(struct mwifiex_adapter *adapter, ...@@ -350,8 +350,7 @@ mwifiex_write_data_sync(struct mwifiex_adapter *adapter,
sdio_claim_host(card->func); sdio_claim_host(card->func);
if (!sdio_writesb(card->func, ioport, buffer, blk_cnt * blk_size)) ret = sdio_writesb(card->func, ioport, buffer, blk_cnt * blk_size);
ret = 0;
sdio_release_host(card->func); sdio_release_host(card->func);
...@@ -365,7 +364,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer, ...@@ -365,7 +364,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer,
u32 len, u32 port, u8 claim) u32 len, u32 port, u8 claim)
{ {
struct sdio_mmc_card *card = adapter->card; struct sdio_mmc_card *card = adapter->card;
int ret = -1; int ret;
u8 blk_mode = (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE u8 blk_mode = (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE
: BLOCK_MODE; : BLOCK_MODE;
u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1; u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1;
...@@ -376,8 +375,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer, ...@@ -376,8 +375,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer,
if (claim) if (claim)
sdio_claim_host(card->func); sdio_claim_host(card->func);
if (!sdio_readsb(card->func, buffer, ioport, blk_cnt * blk_size)) ret = sdio_readsb(card->func, buffer, ioport, blk_cnt * blk_size);
ret = 0;
if (claim) if (claim)
sdio_release_host(card->func); sdio_release_host(card->func);
......
...@@ -672,7 +672,7 @@ static int mwifiex_write_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf, ...@@ -672,7 +672,7 @@ static int mwifiex_write_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf,
*len, &actual_length, timeout); *len, &actual_length, timeout);
if (ret) { if (ret) {
dev_err(adapter->dev, "usb_bulk_msg for tx failed: %d\n", ret); dev_err(adapter->dev, "usb_bulk_msg for tx failed: %d\n", ret);
ret = -1; return ret;
} }
*len = actual_length; *len = actual_length;
...@@ -691,7 +691,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf, ...@@ -691,7 +691,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf,
*len, &actual_length, timeout); *len, &actual_length, timeout);
if (ret) { if (ret) {
dev_err(adapter->dev, "usb_bulk_msg for rx failed: %d\n", ret); dev_err(adapter->dev, "usb_bulk_msg for rx failed: %d\n", ret);
ret = -1; return ret;
} }
*len = actual_length; *len = actual_length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册