From patchwork Thu Jun 22 07:54:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 106186 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2331626qgd; Thu, 22 Jun 2017 00:56:13 -0700 (PDT) X-Received: by 10.80.145.25 with SMTP id e25mr1612267eda.8.1498118173620; Thu, 22 Jun 2017 00:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498118173; cv=none; d=google.com; s=arc-20160816; b=n8T0l2mTlUSRZ0EcOrAKZ3PIElucvRp7v1c907hU9XP+4xJ1Y4X9fIj1PKsbsjALiC wpZoBQDJaw0e6sesy3NXWgOKIQx13N+wt2TMRciqizNX80SNKntMOi5t8uUKft6n7gEF ZgAiRh+9SzSXZ29sl6MRU2OvHVyCVWrDsM3EL2QzGODOTKaPv+Oev1ro0eVK63Yy8nNM SMjbTNQGit9BJ2ocHbrAJrLqmdyotIt2luTvGSOp10rj/AcJ5rgbOuwEDN63f5sPAMNt F+Uuk3oN25cRya7ESFsu5uG7dm2LRTSSEHVsV69EOhQXaeHT7wDHA+fn2bYwChaHHj5N I6Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=9KRt12y1zSjxDxR4kb8yO/ZM9HARtAnLwLvCigGOgOI=; b=iiBSNc+FWsPgQ3GBiCD+1sYXSCDW9ECZ+hZOe8XYn9fCsjs7PFSCaujZnOOUo/g4JG CKO7Y7U15wLfmCvf5hErLHkiv2V1nqnwhInCDTNcyq7o34RV1oQLpDawc5qU/fmRi4NN 8w26YLeABSGvlpi3yi7nJb5/No0eV9U3il0aymYJ9KsZjl3t8YabdtjxKxhOWHnOQwen sNoo4o8h3UjEu6O/shEzxRy/eI+HEE8DV+3DYSTQxyhSSlAggutXxGzbny2SYhS7Y1lw R4OtmvtIwQw2DYBk9I5rnlHLW+YWvtqX5BOF85t9dvh/KUzwy2gXL76kW8q4erEAST+d ddmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=Jm+mM3sN; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id i30si1117827edd.219.2017.06.22.00.56.13; Thu, 22 Jun 2017 00:56:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=Jm+mM3sN; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 29CFBC21CB4; Thu, 22 Jun 2017 07:55:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2A6DDC21CAB; Thu, 22 Jun 2017 07:54:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2C6E4C21C66; Thu, 22 Jun 2017 07:54:34 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id 3211FC21C3E for ; Thu, 22 Jun 2017 07:54:32 +0000 (UTC) Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id v5M7s9k6009287; Thu, 22 Jun 2017 16:54:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v5M7s9k6009287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498118050; bh=trEKLhci4XNyZkguW10uf8a2tS2OOgbiosAKeodENlQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jm+mM3sN2orU6VrwZNhLeK8w6hQPU3vNGxsEFqCEdQdKPibi9aXhSmOPCTtgAvfGk iiPzTxiY+aNXVIPjELjXoiSJH9IKnG4TYUppNW4XU07TqkuT61LvI05+0ZBHXKoF8q IAspaks6wlDcjgjonX+e+BO15M+aKNl+5YcCSZotuY++qOwTDA9o5KmtMkK6kQpvUV kfMTEEfeA1W99Gba7ZfOnwvhZxFZoadLhqfDpMBAXrlloVNH11tTyXjTGkMN67OCyz 9zEQh7J3avGyydt8EEswHPoi3olvZgH1Fia1aqf4Jd/EtV3sV2EBjRZCyhAwDivFuq XExQFN+1ft/Sw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 22 Jun 2017 16:54:04 +0900 Message-Id: <1498118047-11918-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498118047-11918-1-git-send-email-yamada.masahiro@socionext.com> References: <1498118047-11918-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 2/5] dm: ofnode: simplify ofnode_read_prop() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The code inside the if-block is the same as of_get_property(). Signed-off-by: Masahiro Yamada Acked-by: Simon Glass Acked-by: Simon Glass --- drivers/core/ofnode.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index b8b16bf5e275..08b3e03b1e8e 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -424,17 +424,11 @@ int ofnode_decode_display_timing(ofnode parent, int index, const u32 *ofnode_read_prop(ofnode node, const char *propname, int *lenp) { - if (ofnode_is_np(node)) { - struct property *prop; - - prop = of_find_property(ofnode_to_np(node), propname, lenp); - if (!prop) - return NULL; - return prop->value; - } else { + if (ofnode_is_np(node)) + return of_get_property(ofnode_to_np(node), propname, lenp); + else return fdt_getprop(gd->fdt_blob, ofnode_to_offset(node), propname, lenp); - } } bool ofnode_is_available(ofnode node)