From patchwork Fri Dec 22 21:13:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 122665 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2745988qgn; Fri, 22 Dec 2017 13:18:07 -0800 (PST) X-Google-Smtp-Source: ACJfBoujZjiHY+gdZkcoThYO0ukwkb94ArmaPlrj6eBjvpAwcyM3a/jcFV4d7DC8Nu7940Yj6kPp X-Received: by 10.80.152.24 with SMTP id g24mr17527280edb.173.1513977486845; Fri, 22 Dec 2017 13:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513977486; cv=none; d=google.com; s=arc-20160816; b=cKOytGq86PnreMjm0+oXOMbZobRqPluA92CSfVVegTfNhzMtYF+mmr+ykUfAt2o7d7 6esOxzc6H4IxnDIeLPMibUI7A16K40JoLqqRXqzJeX9ET4FASq5BHOVOtGijyZ9Ydc4z TWxhbdLcDTQhz9862OmAyU3uqFkmlajg+AL4YOTV/0DitzI/7llIih6BOb9wLPngWejl VgG/DhCsNOBDwSn6e/6PSkp0VPCoMwnDyJ5N4pQkbvGY4TeMxDM464QYfrgAxcLivZdS UN+F9vj5NDzWJkqM3ED7OimBGF/4eN9EbE7S8SCmCxLDeBfa2aI6ZWRI3813rSZ0O4n5 aTFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=EUyZLqF+kwQQlxHpghLRorq0FclFuiakQBHIaMEJWgg=; b=eAZTlWLguyc8cAQLZHFr7K9DAosS0HGtCux2VfjwB5vxOfnplrMr7HQoyZgzi23giV ri6/OpCO3/TBtN5o2pc6rQMyTu8VjxsUK/DKIOHOVvtV+uhUNShwRPNcdYLd2zMLcAjd 9VmrUq9Ncz2P6V5cCPc8rXOu93e4xoeUCH6s0kw3O7rGw1xTulsxIPQVcpyTbfe7RSP/ oZbTmOuW68vaCXDfg22gb8WVmJnu41EZ7VzPNb/H33wZB9/HNRj+MuOL5g9knDP5Ug8I k6FGXmXeddAhOcWWS872EqUg2dCyuE1exq5TFDPbZEpkRo37mNKohtp/GUaty3Ypmsut VuBA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id d34si973063edd.545.2017.12.22.13.18.06; Fri, 22 Dec 2017 13:18:06 -0800 (PST) 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; 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 Received: by lists.denx.de (Postfix, from userid 105) id 59224C2200B; Fri, 22 Dec 2017 21:17:03 +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=none 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 45D81C2221F; Fri, 22 Dec 2017 21:14:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6C76FC2221F; Fri, 22 Dec 2017 21:14:22 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id E6BBCC2200F for ; Fri, 22 Dec 2017 21:14:17 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1B665207CA; Fri, 22 Dec 2017 22:14:17 +0100 (CET) Received: from localhost.localdomain (unknown [80.12.41.248]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7282D203A1; Fri, 22 Dec 2017 22:14:16 +0100 (CET) From: Quentin Schulz To: jagan@openedev.com, maxime.ripard@free-electrons.com, hdegoede@redhat.com, sjg@chromium.org, wd@denx.de, andre.przywara@arm.com, lukma@denx.de Date: Fri, 22 Dec 2017 22:13:42 +0100 Message-Id: <653352d39996fef8dd4947c423ab33b0abae1765.1513975247.git-series.quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Cc: thomas.petazzoni@free-electrons.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH 08/11] env: add env_driver parameter to env_import_redund 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" To prepare for an upcoming patch that uses the location of the driver used when doing an env_import_redund, add env_driver as an argument of env_import_redund so that it can be used within. Update all calls to this function and the prototype. Signed-off-by: Quentin Schulz --- env/common.c | 2 +- env/nand.c | 2 +- env/ubi.c | 2 +- include/environment.h | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/env/common.c b/env/common.c index 75b8334..24cf41b 100644 --- a/env/common.c +++ b/env/common.c @@ -197,7 +197,7 @@ int env_import(const char *buf, int check) #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT static unsigned char env_flags; -int env_import_redund(const char *buf1, const char *buf2) +int env_import_redund(struct env_driver *drv, const char *buf1, const char *buf2) { int crc1_ok, crc2_ok; env_t *ep, *tmp_env1, *tmp_env2; diff --git a/env/nand.c b/env/nand.c index 6ed3c26..49e506e 100644 --- a/env/nand.c +++ b/env/nand.c @@ -352,7 +352,7 @@ static int env_nand_load(struct env_driver *drv) gd->env_valid = ENV_REDUND; env_import((char *)tmp_env2, 1); } else { - env_import_redund((char *)tmp_env1, (char *)tmp_env2); + env_import_redund(drv, (char *)tmp_env1, (char *)tmp_env2); } done: diff --git a/env/ubi.c b/env/ubi.c index a649999..51b61eb 100644 --- a/env/ubi.c +++ b/env/ubi.c @@ -130,7 +130,7 @@ static int env_ubi_load(struct env_driver *drv) CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME_REDUND); } - env_import_redund((char *)tmp_env1, (char *)tmp_env2); + env_import_redund(drv, (char *)tmp_env1, (char *)tmp_env2); return 0; } diff --git a/include/environment.h b/include/environment.h index 34a0d5e..1e9254f 100644 --- a/include/environment.h +++ b/include/environment.h @@ -318,7 +318,8 @@ int env_export(env_t *env_out); #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT /* Select and import one of two redundant environments */ -int env_import_redund(const char *buf1, const char *buf2); +int env_import_redund(struct env_driver *drv, const char *buf1, + const char *buf2); #endif /**