From: Tom Rini Date: Thu, 21 Mar 2013 08:16:10 -0400 Subject: [U-Boot] [PATCH v3 2/2] omap_hsmmc: Use -EINVAL not -1 for errors In-Reply-To: <1363868170-16573-1-git-send-email-trini@ti.com> References: <1363868170-16573-1-git-send-email-trini@ti.com> Message-ID: <1363868170-16573-2-git-send-email-trini@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Signed-off-by: Tom Rini --- Changes in v3: - Reapply with style changes in previous patch - Add missing Changes in v2: - New patch, use -EINVAL in the driver --- drivers/mmc/omap_hsmmc.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c index d599482..53aa2bd 100644 --- a/drivers/mmc/omap_hsmmc.c +++ b/drivers/mmc/omap_hsmmc.c @@ -34,6 +34,7 @@ #include #include #include +#include /* common definitions for all OMAPs */ #define SYSCTL_SRC (1 << 25) @@ -59,13 +60,13 @@ static struct omap_hsmmc_data hsmmc_dev_data[3]; static int omap_mmc_setup_gpio_in(int gpio, const char *label) { if (!gpio_is_valid(gpio)) - return -1; + return -EINVAL; if (gpio_request(gpio, label) < 0) - return -1; + return -EINVAL; if (gpio_direction_input(gpio) < 0) - return -1; + return -EINVAL; return gpio; } @@ -77,7 +78,7 @@ static int omap_mmc_getcd(struct mmc *mmc) if (gpio_is_valid(cd_gpio)) return gpio_get_value(cd_gpio); - return -1; + return -EINVAL; } static int omap_mmc_getwp(struct mmc *mmc) @@ -87,12 +88,12 @@ static int omap_mmc_getwp(struct mmc *mmc) if (gpio_is_valid(wp_gpio)) return gpio_get_value(wp_gpio); - return -1; + return -EINVAL; } #else static inline int omap_mmc_setup_gpio_in(int gpio, const char *label) { - return -1; + return -EINVAL; } #define omap_mmc_getcd NULL @@ -401,7 +402,7 @@ static int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, mmc_reset_controller_fsm(mmc_base, SYSCTL_SRC); return TIMEOUT; } else if ((mmc_stat & ERRI_MASK) != 0) - return -1; + return -EINVAL; if (mmc_stat & CC_MASK) { writel(CC_MASK, &mmc_base->stat); -- 1.7.9.5