From patchwork Fri Nov 21 10:47:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 412997 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 69546140180 for ; Fri, 21 Nov 2014 21:47:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A09FA4B8E2; Fri, 21 Nov 2014 11:47:27 +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 bYUHYRh7t-BB; Fri, 21 Nov 2014 11:47:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D3B64B8DB; Fri, 21 Nov 2014 11:47:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B34F44B8DB for ; Fri, 21 Nov 2014 11:47:21 +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 T32v0kAGWLLs for ; Fri, 21 Nov 2014 11:47:21 +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 smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 0678E4B8D9 for ; Fri, 21 Nov 2014 11:47:17 +0100 (CET) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile12) with ESMTP id sALAlBZL015346; Fri, 21 Nov 2014 19:47:11 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili13) with ESMTP id sALAlBJ05740; Fri, 21 Nov 2014 19:47:11 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id sALAlBOV007511; Fri, 21 Nov 2014 19:47:11 +0900 Received: from poodle by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id sALAlBfM007469; Fri, 21 Nov 2014 19:47:11 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 8E7A82740043; Fri, 21 Nov 2014 19:47:11 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Fri, 21 Nov 2014 19:47:08 +0900 Message-Id: <1416566828-3776-1-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 Subject: [U-Boot] [PATCH] fdt: remove fdtdec_get_alias_node() function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 The fdt_path_offset() checks an alias too. fdtdec_get_alias_node(blob, "foo") is equivalent to fdt_path_offset(blob, "foo"). Signed-off-by: Masahiro Yamada Acked-by: Simon Glass --- drivers/serial/serial-uclass.c | 2 +- include/fdtdec.h | 11 ----------- lib/fdtdec.c | 15 --------------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 71f1a5c..28dccfa 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -34,7 +34,7 @@ static void serial_find_console_or_panic(void) /* Check for a chosen console */ node = fdtdec_get_chosen_node(gd->fdt_blob, "stdout-path"); if (node < 0) - node = fdtdec_get_alias_node(gd->fdt_blob, "console"); + node = fdt_path_offset(gd->fdt_blob, "console"); if (!uclass_get_device_by_of_offset(UCLASS_SERIAL, node, &cur_dev)) return; diff --git a/include/fdtdec.h b/include/fdtdec.h index 4ae77be..6e01cce 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -388,17 +388,6 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int node, int *seqp); /** - * Get the offset of the given alias node - * - * This looks up an alias in /aliases then finds the offset of that node. - * - * @param blob Device tree blob (if NULL, then error is returned) - * @param name Alias name, e.g. "console" - * @return Node offset referred to by that alias, or -ve FDT_ERR_... - */ -int fdtdec_get_alias_node(const void *blob, const char *name); - -/** * Get the offset of the given chosen node * * This looks up a property in /chosen containing the path to another node, diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 9714620..2c9d694 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -368,21 +368,6 @@ int fdtdec_get_alias_seq(const void *blob, const char *base, int offset, return -ENOENT; } -int fdtdec_get_alias_node(const void *blob, const char *name) -{ - const char *prop; - int alias_node; - int len; - - if (!blob) - return -FDT_ERR_NOTFOUND; - alias_node = fdt_path_offset(blob, "/aliases"); - prop = fdt_getprop(blob, alias_node, name, &len); - if (!prop) - return -FDT_ERR_NOTFOUND; - return fdt_path_offset(blob, prop); -} - int fdtdec_get_chosen_node(const void *blob, const char *name) { const char *prop;