From patchwork Wed Nov 28 01:31:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 202339 X-Patchwork-Delegate: sbabic@denx.de 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 93B8B2C0087 for ; Wed, 28 Nov 2012 12:32:50 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 530104A116; Wed, 28 Nov 2012 02:32:39 +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 3i1hpXDpg5Bx; Wed, 28 Nov 2012 02:32:39 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 546A44A0BD; Wed, 28 Nov 2012 02:32:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C10784A094 for ; Wed, 28 Nov 2012 02:31:59 +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 DHGFSZ830mYG for ; Wed, 28 Nov 2012 02:31:59 +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-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by theia.denx.de (Postfix) with ESMTPS id 0E1004A09E for ; Wed, 28 Nov 2012 02:31:53 +0100 (CET) Received: by mail-pa0-f44.google.com with SMTP id hz11so6994243pad.3 for ; Tue, 27 Nov 2012 17:31:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=RX8oIk95QGzC8aDTqLWIURpqHNCR4kjJpnAVCup92EA=; b=hbFXzQZtZGUrZrAC9OhCcf9Ln9L/v0E/buR6XUTMuSPZdPSOXV5yD6oJJl16OHu2ML 4bBfWOMgZbaDhONRB+fOXk0FJWdaxGTSLg6jTD5jpQLwJf/L0AH6FyE9G8Isg4ubJnCY X/9jdCOQ89XGdXVmlLZ/8DCqa4qR6YBVXo7CgbGnRBDtgSlIT6SRrDtUYuoxcN3EJrw4 x6CacTYlVKodLlaHOlayV3kL1xaMKiMA+BcTsEMxT+99M1mBcpz9Q7ef7U5RQRZBn6V6 Gmrkliop0AvCs9bfhUwqhuCIqUOGGPd0oL5qk+c8Q+YvRVPvB4aYtZIlsFaWTlslVLrK eYjw== Received: by 10.68.137.198 with SMTP id qk6mr53487455pbb.60.1354066311322; Tue, 27 Nov 2012 17:31:51 -0800 (PST) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPS id t1sm11560054paw.11.2012.11.27.17.31.47 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 17:31:49 -0800 (PST) Received: from tkisky by officeserver-2 with local (Exim 4.76) (envelope-from ) id 1TdWVC-0007l0-6D; Tue, 27 Nov 2012 18:31:50 -0700 From: Troy Kisky To: sbabic@denx.de Date: Tue, 27 Nov 2012 18:31:39 -0700 Message-Id: <1354066303-29762-8-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1354066303-29762-1-git-send-email-troy.kisky@boundarydevices.com> References: <1349315254-21151-9-git-send-email-troy.kisky@boundarydevices.com> <1354066303-29762-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQlLSCwzlGVuNEXA42eRkYOAmcH6yJczz5sn/mBbWOg6vE8JFRPBq5mlc5HHHDm5y/ictAmj Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH V4 07/11] imximage: move set_dcd_val to struct data_src 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: Troy Kisky Acked-by: Jason Liu --- v3: new patch --- tools/imximage.c | 9 ++++----- tools/imximage.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/imximage.c b/tools/imximage.c index 30f3c81..6d5cfa7 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -65,7 +65,6 @@ static table_entry_t imximage_versions[] = { {-1, "", " (Invalid)", }, }; -static set_dcd_val_t set_dcd_val; static set_dcd_rst_t set_dcd_rst; static uint32_t max_dcd_entries; static uint32_t *header_size_ptr; @@ -256,13 +255,13 @@ static void set_hdr_func(struct data_src *ds, uint32_t imximage_version) { switch (imximage_version) { case IMXIMAGE_V1: - set_dcd_val = set_dcd_val_v1; + ds->set_dcd_val = set_dcd_val_v1; set_dcd_rst = set_dcd_rst_v1; ds->set_imx_hdr = set_imx_hdr_v1; max_dcd_entries = MAX_HW_CFG_SIZE_V1; break; case IMXIMAGE_V2: - set_dcd_val = set_dcd_val_v2; + ds->set_dcd_val = set_dcd_val_v2; set_dcd_rst = set_dcd_rst_v2; ds->set_imx_hdr = set_imx_hdr_v2; max_dcd_entries = MAX_HW_CFG_SIZE_V2; @@ -360,7 +359,7 @@ static void parse_cfg_cmd(struct data_src *ds, int32_t cmd, char *token, break; case CMD_DATA: value = get_cfg_value(token, name, lineno); - (*set_dcd_val)(ds, name, lineno, fld, value, dcd_len); + (*ds->set_dcd_val)(ds, name, lineno, fld, value, dcd_len); if (unlikely(cmd_ver_first != 1)) cmd_ver_first = 0; break; @@ -391,7 +390,7 @@ static void parse_cfg_fld(struct data_src *ds, int32_t *cmd, return; value = get_cfg_value(token, name, lineno); - (*set_dcd_val)(ds, name, lineno, fld, value, *dcd_len); + (*ds->set_dcd_val)(ds, name, lineno, fld, value, *dcd_len); if (fld == CFG_REG_VALUE) { (*dcd_len)++; diff --git a/tools/imximage.h b/tools/imximage.h index f27a2ef..444ddce 100644 --- a/tools/imximage.h +++ b/tools/imximage.h @@ -175,5 +175,6 @@ typedef int (*set_imx_hdr_t)(struct data_src *ds, uint32_t dcd_len, struct data_src { struct imx_header *imxhdr; set_imx_hdr_t set_imx_hdr; + set_dcd_val_t set_dcd_val; }; #endif /* _IMXIMAGE_H_ */