From patchwork Wed Sep 3 16:32:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Bigot X-Patchwork-Id: 385572 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 499DC1401FA for ; Thu, 4 Sep 2014 02:32:57 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A65B6A7662; Wed, 3 Sep 2014 18:32:54 +0200 (CEST) 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 11FcQ29VA4C5; Wed, 3 Sep 2014 18:32:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E797A7541; Wed, 3 Sep 2014 18:32:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 96CDBA7541 for ; Wed, 3 Sep 2014 18:32:49 +0200 (CEST) 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 RLKeTUEbampg for ; Wed, 3 Sep 2014 18:32:46 +0200 (CEST) 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 p3plsmtpa07-10.prod.phx3.secureserver.net (p3plsmtpa07-10.prod.phx3.secureserver.net [173.201.192.239]) by theia.denx.de (Postfix) with ESMTP id 1196DA7489 for ; Wed, 3 Sep 2014 18:32:42 +0200 (CEST) Received: from llc.pab ([66.41.60.82]) by p3plsmtpa07-10.prod.phx3.secureserver.net with id mgYb1o00e1mTNtu01gYciM; Wed, 03 Sep 2014 09:32:41 -0700 From: "Peter A. Bigot" To: u-boot@lists.denx.de Date: Wed, 3 Sep 2014 11:32:18 -0500 Message-Id: <1409761938-27902-1-git-send-email-pab@pabigot.com> X-Mailer: git-send-email 1.8.5.5 In-Reply-To: <1409700683-25393-2-git-send-email-pab@pabigot.com> References: <1409700683-25393-2-git-send-email-pab@pabigot.com> Cc: trini@ti.com, panto@antoniou-consulting.com Subject: [U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition 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 The code to set the MMC partition uses an weak function to obtain the correct partition number. Use that instead of the compile-time default when deciding whether it needs to switch back. Signed-off-by: Peter A. Bigot --- V2: * Preserve desired behavior of avoiding diagnostic when no HW partition supported * Supersedes https://patchwork.ozlabs.org/patch/385355/ common/env_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/env_mmc.c b/common/env_mmc.c index a7621a8..14648e3 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -113,7 +113,7 @@ static void fini_mmc_for_env(struct mmc *mmc) #ifdef CONFIG_SPL_BUILD dev = 0; #endif - if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num) + if (mmc_get_env_part(mmc) != mmc->part_num) mmc_switch_part(dev, mmc->part_num); #endif }