diff options
author | Bing Zhao <bzhao@marvell.com> | 2013-01-25 21:23:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-01-30 15:07:05 -0500 |
commit | 5b2e2eccab80e2f56d06df582e473fb0d8630f35 (patch) | |
tree | 29e778882c1742943f3a5201ab3903254b985843 | |
parent | 3220712d3aa4f5df12b7305ce340f6d216a84477 (diff) |
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: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/mwifiex/sdio.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/usb.c | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 5a1c1d0e5599..e35b67a9e6a6 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -332,7 +332,7 @@ mwifiex_write_data_sync(struct mwifiex_adapter *adapter, | |||
332 | u8 *buffer, u32 pkt_len, u32 port) | 332 | u8 *buffer, u32 pkt_len, u32 port) |
333 | { | 333 | { |
334 | struct sdio_mmc_card *card = adapter->card; | 334 | struct sdio_mmc_card *card = adapter->card; |
335 | int ret = -1; | 335 | int ret; |
336 | u8 blk_mode = | 336 | u8 blk_mode = |
337 | (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE; | 337 | (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE : BLOCK_MODE; |
338 | u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1; | 338 | 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 | 350 | ||
351 | sdio_claim_host(card->func); | 351 | sdio_claim_host(card->func); |
352 | 352 | ||
353 | if (!sdio_writesb(card->func, ioport, buffer, blk_cnt * blk_size)) | 353 | ret = sdio_writesb(card->func, ioport, buffer, blk_cnt * blk_size); |
354 | ret = 0; | ||
355 | 354 | ||
356 | sdio_release_host(card->func); | 355 | sdio_release_host(card->func); |
357 | 356 | ||
@@ -365,7 +364,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *buffer, | |||
365 | u32 len, u32 port, u8 claim) | 364 | u32 len, u32 port, u8 claim) |
366 | { | 365 | { |
367 | struct sdio_mmc_card *card = adapter->card; | 366 | struct sdio_mmc_card *card = adapter->card; |
368 | int ret = -1; | 367 | int ret; |
369 | u8 blk_mode = (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE | 368 | u8 blk_mode = (port & MWIFIEX_SDIO_BYTE_MODE_MASK) ? BYTE_MODE |
370 | : BLOCK_MODE; | 369 | : BLOCK_MODE; |
371 | u32 blk_size = (blk_mode == BLOCK_MODE) ? MWIFIEX_SDIO_BLOCK_SIZE : 1; | 370 | 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 | if (claim) | 375 | if (claim) |
377 | sdio_claim_host(card->func); | 376 | sdio_claim_host(card->func); |
378 | 377 | ||
379 | if (!sdio_readsb(card->func, buffer, ioport, blk_cnt * blk_size)) | 378 | ret = sdio_readsb(card->func, buffer, ioport, blk_cnt * blk_size); |
380 | ret = 0; | ||
381 | 379 | ||
382 | if (claim) | 380 | if (claim) |
383 | sdio_release_host(card->func); | 381 | sdio_release_host(card->func); |
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index 5d4a10a8a005..f90fe21e5bfd 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c | |||
@@ -672,7 +672,7 @@ static int mwifiex_write_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf, | |||
672 | *len, &actual_length, timeout); | 672 | *len, &actual_length, timeout); |
673 | if (ret) { | 673 | if (ret) { |
674 | dev_err(adapter->dev, "usb_bulk_msg for tx failed: %d\n", ret); | 674 | dev_err(adapter->dev, "usb_bulk_msg for tx failed: %d\n", ret); |
675 | ret = -1; | 675 | return ret; |
676 | } | 676 | } |
677 | 677 | ||
678 | *len = actual_length; | 678 | *len = actual_length; |
@@ -691,7 +691,7 @@ static int mwifiex_read_data_sync(struct mwifiex_adapter *adapter, u8 *pbuf, | |||
691 | *len, &actual_length, timeout); | 691 | *len, &actual_length, timeout); |
692 | if (ret) { | 692 | if (ret) { |
693 | dev_err(adapter->dev, "usb_bulk_msg for rx failed: %d\n", ret); | 693 | dev_err(adapter->dev, "usb_bulk_msg for rx failed: %d\n", ret); |
694 | ret = -1; | 694 | return ret; |
695 | } | 695 | } |
696 | 696 | ||
697 | *len = actual_length; | 697 | *len = actual_length; |