summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2016-05-27 10:18:17 -0400
committerKalle Valo <kvalo@codeaurora.org>2016-06-16 18:05:06 +0300
commit032e0f546c7e36217ebcae33f82d390c272d00ea (patch)
treebc96d328cf621db17405aec2254a19d0b5608095 /drivers/net/wireless/marvell
parentcc524d1706b775466bf16a0a1130105ae5c70f43 (diff)
downloadop-kernel-dev-032e0f546c7e36217ebcae33f82d390c272d00ea.zip
op-kernel-dev-032e0f546c7e36217ebcae33f82d390c272d00ea.tar.gz
mwifiex: propagate mwifiex_add_card() errno code in mwifiex_sdio_probe()
There's only a check if mwifiex_add_card() returned a nonzero value, but the actual error code is neither stored nor propagated to the caller. So instead of always returning -1 (which is -EPERM and not a suitable errno code in this case), propagate the value returned by mwifiex_add_card(). Patch also removes the assignment of sdio_disable_func() returned value since it was overwritten anyways and what matters is to know the error value returned by the first function that failed. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/sdio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
index 138dc1f..b248d10 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -191,14 +191,14 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
if (func->dev.of_node)
mwifiex_sdio_probe_of(&func->dev, card);
- if (mwifiex_add_card(card, &add_remove_card_sem, &sdio_ops,
- MWIFIEX_SDIO)) {
+ ret = mwifiex_add_card(card, &add_remove_card_sem, &sdio_ops,
+ MWIFIEX_SDIO);
+ if (ret) {
pr_err("%s: add card failed\n", __func__);
kfree(card);
sdio_claim_host(func);
- ret = sdio_disable_func(func);
+ sdio_disable_func(func);
sdio_release_host(func);
- ret = -1;
}
return ret;
OpenPOWER on IntegriCloud