From patchwork Thu Mar 21 12:16:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 229651 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 53A312C009C for ; Thu, 21 Mar 2013 23:16:38 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C686D4A036; Thu, 21 Mar 2013 13:16:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id l4GdbB3JnYnJ; Thu, 21 Mar 2013 13:16:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C3874A04C; Thu, 21 Mar 2013 13:16:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2802C4A03A for ; Thu, 21 Mar 2013 13:16:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r4CyiAC8JL7O for ; Thu, 21 Mar 2013 13:16:20 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by theia.denx.de (Postfix) with ESMTPS id 4343F4A027 for ; Thu, 21 Mar 2013 13:16:15 +0100 (CET) Received: by mail-qa0-f43.google.com with SMTP id l8so1244404qaq.2 for ; Thu, 21 Mar 2013 05:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:x-mailer :in-reply-to:references; bh=ixlOseyuI/aKb8rdspA6vSaq2dtTYKQ7Rlll8Httujw=; b=E3jD2ngMzTmCfEzzr+3RSqk7b+VrhM77TXIDRiC5vHTWTz7UFEN186zycsBrGOldaa PvKlpojBNzHpPVvSFgKkVl3Ff4kbdV0AToYGMXWpGk1PKYZhnVWtWo9//zUU5NKCUics 55PWiEm4px85QRrL9E5y6JDNmY+wvfDBbsaZy4VT3XhEB0DY6i2Q7KHTBHAKgOfF2Uzr QQk8hHywOGyt83ULj6IhgEk06ZyPG2KFwvAJusHVlYFymfnQY519b6d6pQtBotTqaKmz kNYnL3lvSjKfZ9FsioSnS+NAySPkWRQ8i7e9RbPzxSk7QLtC2N2OQPwsA/zc4asV5iJ0 FBCw== X-Received: by 10.224.168.144 with SMTP id u16mr9598005qay.18.1363868174976; Thu, 21 Mar 2013 05:16:14 -0700 (PDT) Received: from localhost.localdomain (cpe-065-184-250-089.ec.res.rr.com. [65.184.250.89]) by mx.google.com with ESMTPS id gn6sm57389637qab.5.2013.03.21.05.16.12 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 05:16:13 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Thu, 21 Mar 2013 08:16:10 -0400 Message-Id: <1363868170-16573-2-git-send-email-trini@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363868170-16573-1-git-send-email-trini@ti.com> References: <1363868170-16573-1-git-send-email-trini@ti.com> Subject: [U-Boot] [PATCH v3 2/2] omap_hsmmc: Use -EINVAL not -1 for errors X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@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);