From patchwork Thu Nov 1 00:02:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 196061 X-Patchwork-Delegate: vanbaren@cideas.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 466CA2C00D6 for ; Thu, 1 Nov 2012 11:03:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2AD24A56D; Thu, 1 Nov 2012 01:03:17 +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 FVbqZYkgnOF9; Thu, 1 Nov 2012 01:03:17 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE8894A56F; Thu, 1 Nov 2012 01:03:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 460B04A56F for ; Thu, 1 Nov 2012 01:03:13 +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 cJaHhMfmvGPy for ; Thu, 1 Nov 2012 01:03:12 +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-wi0-f202.google.com (mail-wi0-f202.google.com [209.85.212.202]) by theia.denx.de (Postfix) with ESMTPS id 5BF454A56D for ; Thu, 1 Nov 2012 01:03:10 +0100 (CET) Received: by mail-wi0-f202.google.com with SMTP id hr7so124335wib.3 for ; Wed, 31 Oct 2012 17:03:10 -0700 (PDT) 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:x-gm-message-state; bh=PfQoyQWDAeUeI672XWLT9RczTBxR8yhEz+6377xRhPA=; b=JEAsdWPj2CU6PhsPkiuqgEXwZ27Pgf1EJHTYbKwPcvZf1FWnen5B57eDQ+FBZhTg3R w226xSeS5igw7BhCdzh+TYDllL/WPOU88pLZW4wzUU8Cah3AziyTDH2RnVR/i2gWgx7p SleNnW6v0lr/eXESLYNfwnaB3cEW94EAe6aRlDsu7S6bxh02wIFBdOtEYKciIH41p2VE OGJUSEcha+QNfOXTsx8N5kfBHIF/iP841wftc0MQj1gROj2/0ePEnCbMKdOkL6C5GBvG w1Fo4QKLQ3SidoS28A8HSD5eTfIMFJzzB14UKSRS7ceNx79dWvoZkM1AnFTxW+++1HgI amYg== Received: by 10.14.209.66 with SMTP id r42mr44973840eeo.1.1351728190478; Wed, 31 Oct 2012 17:03:10 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si233928een.1.2012.10.31.17.03.10 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 31 Oct 2012 17:03:10 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 1EC645C0050; Wed, 31 Oct 2012 17:03:10 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 67A29160B8C; Wed, 31 Oct 2012 17:03:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 31 Oct 2012 17:02:42 -0700 Message-Id: <1351728171-27070-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQlu3M9lFYmjhkQxW2vHX14Tx/5M165FDUjuLYjb0Ns4q8zQ/pZAjMq4vXXB3iZEaMCs6PUvsfEx89X1ESj4w7vw8DAHE0iyRW2gI//uRa81MvXz295+iSKdC8gck+3HF7nZEQ4KnyuXCa3eX9evr4sRRWXLEJ9KPaj2DpW6qt80bTlRFc6N3rGjwcRhltMgjOArPKUA Cc: Tom Rini , Jerry Van Baren , Devicetree Discuss Subject: [U-Boot] [PATCH v2 05/14] fdt: Remove fdtdec_find_alias_node() function 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 This function is not needed, since fdt_path_offset() performs the same service. Remove it. Signed-off-by: Simon Glass --- Changes in v2: - Remove fdtdec_find_alias_node() function lib/fdtdec.c | 24 +----------------------- 1 files changed, 1 insertions(+), 23 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 32f03cc..4d6d392 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -52,28 +52,6 @@ const char *fdtdec_get_compatible(enum fdt_compat_id id) return compat_names[id]; } -/** - * Look in the FDT for an alias with the given name and return its node. - * - * @param blob FDT blob - * @param name alias name to look up - * @return node offset if found, or an error code < 0 otherwise - */ -static int find_alias_node(const void *blob, const char *name) -{ - const char *path; - int alias_node; - - debug("find_alias_node: %s\n", name); - alias_node = fdt_path_offset(blob, "/aliases"); - if (alias_node < 0) - return alias_node; - path = fdt_getprop(blob, alias_node, name, NULL); - if (!path) - return -FDT_ERR_NOTFOUND; - return fdt_path_offset(blob, path); -} - fdt_addr_t fdtdec_get_addr(const void *blob, int node, const char *prop_name) { @@ -171,7 +149,7 @@ int fdtdec_next_alias(const void *blob, const char *name, /* snprintf() is not available */ assert(strlen(name) < MAX_STR_LEN); sprintf(str, "%.*s%d", MAX_STR_LEN, name, *upto); - node = find_alias_node(blob, str); + node = fdt_path_offset(blob, str); if (node < 0) return node; err = fdt_node_check_compatible(blob, node, compat_names[id]);