From patchwork Thu Sep 21 14:29:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Jacques Hiblot X-Patchwork-Id: 113262 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp1965143edb; Thu, 21 Sep 2017 07:41:17 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAH0ws4djxPnM5y4u5eNWkJ4DT5gHWEJDURZjnvxW7ClDaNDaahPTt7IaalUIVDgkutrl7N X-Received: by 10.80.130.164 with SMTP id 33mr1387142edg.223.1506004876816; Thu, 21 Sep 2017 07:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506004876; cv=none; d=google.com; s=arc-20160816; b=Vw6b1nf9CE/LNucQWnM/d0MqAa+cURY4fnHKKGoETkyighUsUkzC1dYE3+RSSsB8Cc 489RbVPYU+Xbf5ILJDqol21yYcD8t+QWZyniM9fUPmB2+tS6zrcFe3P6Hd4Bza1t/90x f46BOPvJRe3q2VXPNKldJcxHlBa45BaJ90CR86VQuXGb/cCR1pxzGDIieFFfbiilA3S1 TB0RLoO82Fxxl3AYTadvE8s/Lfrh8HvgSGMpnou8pArN/c0yZrM5YoOOwb5GwrEnPPyQ oK5Q6f2xBEFiuO81vZsvau+Fqzb09Nnhu/YzRRygaxI79wfriuRL+8tHCwW343brkv8W oZIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=VEKnA2bjsXj33xEO3laRB/OighirXcUVypCzz9fpCYo=; b=e5BTCg3hCHyGMH09SnHEBmLideScIX4lbZabfF68oNVI5DXhykRiSZ43F5drxmEPh/ nwk9QcJROOn+ZfSJoeocy2GZrAQaYznhpK3sXpIpOxPEW5SOKuDPN5UKpkdaBbEuKaX2 BNiFusYSuIwpVqpq+1ey4HAVQ0J9Cr9nr3aVGbcq09573g6I/0pweP5JTyLRN+1yBeqj U6O4mGOONs7+avuYK0JnraGtuU7LxTJm6+y0j7AwuJ/rD+oSNvtLyZqYSL/lUVsUNogt 9aJx6wzO6Mv4Z88JXZCsUXgDdJ4RIVjQnFOwpyiAWQm7jq6bUZQpcfmjq7AoGGYrJPHB Q6dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=f27aPRqu; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id j7si1130125edh.504.2017.09.21.07.41.16; Thu, 21 Sep 2017 07:41:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=f27aPRqu; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: by lists.denx.de (Postfix, from userid 105) id 5311EC21F14; Thu, 21 Sep 2017 14:37:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 83512C21FF9; Thu, 21 Sep 2017 14:33:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 51237C21E41; Thu, 21 Sep 2017 14:31:55 +0000 (UTC) Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by lists.denx.de (Postfix) with ESMTPS id D3B59C21FEA for ; Thu, 21 Sep 2017 14:31:51 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v8LEUnrf032481; Thu, 21 Sep 2017 09:30:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1506004249; bh=uGHpL8onwZDomzKprZnBokdV9n4cieq8NeeM7RszJy0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=f27aPRquy28T/ZHbQ3UM0hnc9s1dvLuyWe3HA4CzyS8YrICwXIStGeW0MLcFOTN2d U9+Hnf3CTq4pQ6Do2T5+IvdSMo69xpk98/ax6FztF6xfXFYfHadwXnYBrY/eFofRch oul3rpTdSchcChMtMNXNW452halosw/JttUnWWP0= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LEUiAh028772; Thu, 21 Sep 2017 09:30:44 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Thu, 21 Sep 2017 09:30:44 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Thu, 21 Sep 2017 09:30:44 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v8LEUgt3000905; Thu, 21 Sep 2017 09:30:43 -0500 From: Jean-Jacques Hiblot To: , , , Date: Thu, 21 Sep 2017 16:29:59 +0200 Message-ID: <1506004213-22620-13-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1506004213-22620-1-git-send-email-jjhiblot@ti.com> References: <1506004213-22620-1-git-send-email-jjhiblot@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 12/26] mmc: make mmc_set_ios() return status X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Kishon Vijay Abraham I set_ios callback has a return value of 'int' but the mmc_set_ios() function ignore this. Modify mmc_set_ios() and the callers of mmc_set_ios() to to return the error status. Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Simon Glass --- drivers/mmc/mmc.c | 16 ++++++++++------ include/mmc.h | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 7361447..536cd7f 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1196,14 +1196,18 @@ static inline int bus_width(uint cap) } #if !CONFIG_IS_ENABLED(DM_MMC) -static void mmc_set_ios(struct mmc *mmc) +static int mmc_set_ios(struct mmc *mmc) { + int ret = 0; + if (mmc->cfg->ops->set_ios) - mmc->cfg->ops->set_ios(mmc); + ret = mmc->cfg->ops->set_ios(mmc); + + return ret; } #endif -void mmc_set_clock(struct mmc *mmc, uint clock) +int mmc_set_clock(struct mmc *mmc, uint clock) { if (clock > mmc->cfg->f_max) clock = mmc->cfg->f_max; @@ -1213,14 +1217,14 @@ void mmc_set_clock(struct mmc *mmc, uint clock) mmc->clock = clock; - mmc_set_ios(mmc); + return mmc_set_ios(mmc); } -static void mmc_set_bus_width(struct mmc *mmc, uint width) +static int mmc_set_bus_width(struct mmc *mmc, uint width) { mmc->bus_width = width; - mmc_set_ios(mmc); + return mmc_set_ios(mmc); } #if CONFIG_IS_ENABLED(MMC_VERBOSE) || defined(DEBUG) diff --git a/include/mmc.h b/include/mmc.h index 988bf17..3e57887 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -549,7 +549,7 @@ int mmc_unbind(struct udevice *dev); int mmc_initialize(bd_t *bis); int mmc_init(struct mmc *mmc); int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size); -void mmc_set_clock(struct mmc *mmc, uint clock); +int mmc_set_clock(struct mmc *mmc, uint clock); struct mmc *find_mmc_device(int dev_num); int mmc_set_dev(int dev_num); void print_mmc_devices(char separator);