From patchwork Tue Jun 21 15:54:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrej@inversepath.com X-Patchwork-Id: 638761 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 3rYsjr604Rz9sR8 for ; Wed, 22 Jun 2016 01:54:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D1AB5A7597; Tue, 21 Jun 2016 17:54:38 +0200 (CEST) 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 x0fZzAg8ok_w; Tue, 21 Jun 2016 17:54:38 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C13A6A753A; Tue, 21 Jun 2016 17:54:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D5992A753A for ; Tue, 21 Jun 2016 17:54:34 +0200 (CEST) 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 h2kuFi8YQ9Ob for ; Tue, 21 Jun 2016 17:54:34 +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 core.inversepath.com (core.inversepath.com [91.121.161.97]) by theia.denx.de (Postfix) with ESMTPS id 75787A7524 for ; Tue, 21 Jun 2016 17:54:29 +0200 (CEST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by core.inversepath.com (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id u5LFsQaO021219; Tue, 21 Jun 2016 17:54:26 +0200 From: andrej@inversepath.com To: u-boot@lists.denx.de Date: Tue, 21 Jun 2016 17:54:25 +0200 Message-Id: <20160621155425.22997-1-andrej@inversepath.com> X-Mailer: git-send-email 2.9.0 Subject: [U-Boot] [PATCH] common: Fix support for environment file in EXT4 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" From: Andrej Rosano Signed-off-by: Andrej Rosano --- common/env_ext4.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/common/env_ext4.c b/common/env_ext4.c index ce748ed..adefa7d 100644 --- a/common/env_ext4.c +++ b/common/env_ext4.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ int env_init(void) int saveenv(void) { env_t env_new; - block_dev_desc_t *dev_desc = NULL; + struct blk_desc *dev_desc = NULL; disk_partition_t info; int dev, part; int err; @@ -58,13 +59,13 @@ int saveenv(void) if (err) return err; - part = get_device_and_partition(EXT4_ENV_INTERFACE, + part = blk_get_device_part_str(EXT4_ENV_INTERFACE, EXT4_ENV_DEVICE_AND_PART, &dev_desc, &info, 1); if (part < 0) return 1; - dev = dev_desc->dev; + dev = dev_desc->devnum; ext4fs_set_blk_dev(dev_desc, &info); if (!ext4fs_mount(info.size)) { @@ -90,18 +91,19 @@ int saveenv(void) void env_relocate_spec(void) { ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); - block_dev_desc_t *dev_desc = NULL; + struct blk_desc *dev_desc = NULL; disk_partition_t info; int dev, part; int err; + loff_t off; - part = get_device_and_partition(EXT4_ENV_INTERFACE, + part = blk_get_device_part_str(EXT4_ENV_INTERFACE, EXT4_ENV_DEVICE_AND_PART, &dev_desc, &info, 1); if (part < 0) goto err_env_relocate; - dev = dev_desc->dev; + dev = dev_desc->devnum; ext4fs_set_blk_dev(dev_desc, &info); if (!ext4fs_mount(info.size)) { @@ -110,7 +112,7 @@ void env_relocate_spec(void) goto err_env_relocate; } - err = ext4_read_file(EXT4_ENV_FILE, buf, 0, CONFIG_ENV_SIZE); + err = ext4_read_file(EXT4_ENV_FILE, buf, 0, CONFIG_ENV_SIZE, &off); ext4fs_close(); if (err == -1) {