From patchwork Wed Feb 18 21:10:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 441151 X-Patchwork-Delegate: sjg@chromium.org 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 35B1214007D for ; Thu, 19 Feb 2015 08:13:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C62CD4A05D; Wed, 18 Feb 2015 22:13:25 +0100 (CET) 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 E_QDj0-zOeiO; Wed, 18 Feb 2015 22:13:25 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 371D24B58F; Wed, 18 Feb 2015 22:13:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 856314A053 for ; Wed, 18 Feb 2015 22:13:15 +0100 (CET) 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 CkR0oKOZ92eA for ; Wed, 18 Feb 2015 22:13:15 +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-ob0-f201.google.com (mail-ob0-f201.google.com [209.85.214.201]) by theia.denx.de (Postfix) with ESMTPS id 1F91C4A04C for ; Wed, 18 Feb 2015 22:13:12 +0100 (CET) Received: by mail-ob0-f201.google.com with SMTP id wo20so1382126obc.0 for ; Wed, 18 Feb 2015 13:13:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=04AUk6M71l4J3HWtFmBOvUXfmOVSErakagxFwZUA+G0=; b=SDv+GcpLLrqrP+7yGAuRcDltvqsNqnZHFNOrY+6BD5O9nMEpKxEr56GueFvba1fEf3 ng1DFRTOpw6npfRF9TW0LlzJsMPVQOnV9GOTGLhJBJaKW4v40oKY9eZtxjzoWYDPNGjF qpAZrX+aiJqbWUWDDabwYoiPhEkSwbiuXnte3KDKmfKtXvhwTz/uFogZBpPeP+/kRnPf RsQaj5pIhErQ5KvZkmfr7BONnhGNPd4EKCmQITGS6boqswUJFtSXhBU4lYnLua2BfPI+ 4LSjoKQR30SgdNtM5m+D8JFnetGNOZts0P425lKbZbKpCDdof94agLux/6y8Ji4eb/vB 3KTw== X-Gm-Message-State: ALoCoQlk8IoXu+AXAK1+WXjZiU0cn79qE0qYOWzeCOzOyH8D7Mcg7YbNq0gYZQ77pRM5Fw7RrhBH X-Received: by 10.182.79.168 with SMTP id k8mr1370447obx.49.1424293991894; Wed, 18 Feb 2015 13:13:11 -0800 (PST) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id e5si1863372qcg.1.2015.02.18.13.13.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Feb 2015 13:13:11 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id VusbXdRZ.1; Wed, 18 Feb 2015 13:13:11 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 1214B221720; Wed, 18 Feb 2015 14:13:11 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Wed, 18 Feb 2015 14:10:30 -0700 Message-Id: <1424293849-22193-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1424293849-22193-1-git-send-email-sjg@chromium.org> References: <1424293849-22193-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Jerry Van Baren Subject: [U-Boot] [PATCH 03/22] fdt: Export fdtdec_get_number() for general use 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" This function is missing a prototype but is more widey useful. Add it. Signed-off-by: Simon Glass --- include/fdtdec.h | 11 +++++++++++ lib/fdtdec.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/fdtdec.h b/include/fdtdec.h index 1bc70db..2a96a0a 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -385,6 +385,17 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name, s32 default_val); /** + * Get a variable-sized number from a property + * + * This reads a number from one or more cells. + * + * @param ptr Pointer to property + * @param cells Number of cells containing the number + * @return the value in the cells + */ +u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells); + +/** * Look up a 64-bit integer property in a node and return it. The property * must have at least 8 bytes of data (2 cells). The first two cells are * concatenated to form a 8 bytes value, where the first cell is top half and diff --git a/lib/fdtdec.c b/lib/fdtdec.c index dd58bbb..d4bc8b4 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -917,7 +917,7 @@ int fdtdec_read_fmap_entry(const void *blob, int node, const char *name, return 0; } -static u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells) +u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells) { u64 number = 0;