From d4622df34280830cfe0678f098d3d9f62e6b5d94 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Fri, 23 May 2014 12:47:06 -0600 Subject: mmc: return meaningful error codes from mmc_select_hwpart Rather than just returning -1 everywhere, try to return something meaningful from mmc_select_hwpart(). Note that most other MMC functions don't do this, including functions called from mmc_select_hwpart(), so I'm not sure how effective this will be. Still, it's one less place with hard-coded -1. Suggested-by: Pantelis Antoniou Signed-off-by: Stephen Warren Acked-by: Pantelis Antoniou diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 55c2c68..b5477b1 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -564,19 +565,19 @@ int mmc_select_hwpart(int dev_num, int hwpart) int ret; if (!mmc) - return -1; + return -ENODEV; if (mmc->part_num == hwpart) return 0; if (mmc->part_config == MMCPART_NOAVAILABLE) { printf("Card doesn't support part_switch\n"); - return -1; + return -EMEDIUMTYPE; } ret = mmc_switch_part(dev_num, hwpart); if (ret) - return -1; + return ret; mmc->part_num = hwpart; -- cgit v0.10.2