From patchwork Thu Jun 22 07:54:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 106184 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2331141qgd; Thu, 22 Jun 2017 00:54:38 -0700 (PDT) X-Received: by 10.80.163.200 with SMTP id t8mr1657413edb.158.1498118078876; Thu, 22 Jun 2017 00:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498118078; cv=none; d=google.com; s=arc-20160816; b=M2EKmXb2IKlqSiqJZP4+FTvEJOZK08l1Q8dWHtYz1SYABqn9eo02HnzPAY5PrG/D/v He594HzEnKxMrJEHRq3b+drC9Mg4Y97+Ila3zex7uWe1a2N0hmkJudW9tUaLbOPUogbl l90ckuPeS128fznyyrkG/UDVxwmAMxpNGLKwulrJOBVW021acJ0s51QXKCxonf7pv+IU dJgB93CbZs8UsCt/gMtiNVnY1kKTC90STOBBAuz7ne78m8+BR6yvFbDzgOZHFyQ/k03e N96HK278iiRkZsTGH3Re9rAMtbvCuDgyKYpraXC9vq2wSbpXI0+UxpPf+ms9mIasQnyP ux1Q== 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:message-id:date:to:from:dkim-signature :dkim-filter:arc-authentication-results; bh=PCD2nLYLobXakgE8djMpOm6Xxi4zyYdSRAEQP+Vx8HI=; b=el5P1FM4OB22VUzguphgcXQvzCRcATSoxQsEuUYnAu7Lvul0fkdy0sWxnB7XP/ZD46 fZUULiiTE30r7qYW2KL++vYXj/A4U5ZPwBION3zi44VsggoxyoccP+TKI9FuB1Uw65vZ BgorE/fLsDnDrakWyIQ1iV1oPHPs+PmMKX72Q2LDKCwB4N+HS2PF0AU66fmRRwXdcWBg bf1MgGQmvszHyZ8H0SDeB/F2yRJO+N7oP0i1t7x9oD8ubG0XjV+gHhd4mjJEiS7qc9tH I6j4CBEpMfhy9i8uA2d4yAIdS78E/BbH0kLdshZtOUmsniIk4IBLx5cB3U59wkDumXGn e5gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=fxypzVhi; 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 s12si1136256edb.88.2017.06.22.00.54.38; Thu, 22 Jun 2017 00:54:38 -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=fxypzVhi; 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 4DF3EC21C88; Thu, 22 Jun 2017 07:54:37 +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 93963C21C55; Thu, 22 Jun 2017 07:54:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 154A3C21C67; 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 3F1C4C21C63 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 v5M7s9k5009287; Thu, 22 Jun 2017 16:54:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v5M7s9k5009287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498118049; bh=UbtcUizca85YCepHkXFJero4lf2TbRHXJZw938CzIaQ=; h=From:To:Cc:Subject:Date:From; b=fxypzVhidGKLZF3tnonjYYJKIj18yyIA9mPpiykpJtRcuP4WoB52ZbF7iV5gvFXe/ A8vUoBATRvrxiG8JZ+an8inEZVc+hPJJJl6wB2bZw9D9pLmRmuRIqFch+4gf4OZMei CoNOK0kfLJ7lmuai+OUU0qo+4q2CaUwiYK7HlCO4w8cVJ7CTJmrqU1mFflpz929gRf f9AVcuDyPNOTdx0RoEn9sYSi1shuzy2Sx02cpy8AcqPvDsqBS3ex39jOkQDoJJVLwG 8vsYnIDI7B3HAms2yd21sO5EhJj3GDsEWLPBpUS4FFpMerm51TcCK9aQi/3g6qeNjK FylJOQEM0qBwQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 22 Jun 2017 16:54:03 +0900 Message-Id: <1498118047-11918-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Subject: [U-Boot] [PATCH 1/5] dm: ofnode: use ofnode_read_bool() to check property existence 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" This will clarify the code. Signed-off-by: Masahiro Yamada Acked-by: Simon Glass Acked-by: Simon Glass --- drivers/core/ofnode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index ac312d654654..b8b16bf5e275 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -556,22 +556,22 @@ int ofnode_read_size_cells(ofnode node) bool ofnode_pre_reloc(ofnode node) { - if (ofnode_read_prop(node, "u-boot,dm-pre-reloc", NULL)) + if (ofnode_read_bool(node, "u-boot,dm-pre-reloc")) return true; #ifdef CONFIG_TPL_BUILD - if (ofnode_read_prop(node, "u-boot,dm-tpl", NULL)) + if (ofnode_read_bool(node, "u-boot,dm-tpl")) return true; #elif defined(CONFIG_SPL_BUILD) - if (ofnode_read_prop(node, "u-boot,dm-spl", NULL)) + if (ofnode_read_bool(node, "u-boot,dm-spl")) return true; #else /* * In regular builds individual spl and tpl handling both * count as handled pre-relocation for later second init. */ - if (ofnode_read_prop(node, "u-boot,dm-spl", NULL) || - ofnode_read_prop(node, "u-boot,dm-tpl", NULL)) + if (ofnode_read_bool(node, "u-boot,dm-spl") || + ofnode_read_bool(node, "u-boot,dm-tpl")) return true; #endif 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) From patchwork Thu Jun 22 07:54:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 106188 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2331959qgd; Thu, 22 Jun 2017 00:57:20 -0700 (PDT) X-Received: by 10.80.170.115 with SMTP id p48mr1626805edc.33.1498118239960; Thu, 22 Jun 2017 00:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498118239; cv=none; d=google.com; s=arc-20160816; b=CTPiTIny8l3V9/30hz65MegCgbnfSWVOvZi/yWA+gR8f2d0Tri7M+0aVCvStxd7YCW rp6C+cO14V40GxtZYlTNz8yKzasfQVO8s+XPD2bqlfZnNhh0Hb8zOlV1B6+XyH4MMddh D7nIM0qp1tpFQtexOg9nRy5aS//I89I/51tEGimbNpgbRn5+PAJtwEkK0eUg6hY65+IM ZSB9MXHSXPsdxX9i1Xxk4NoRZgXPQu5MC3sEfHgUeApNXikDHqqsj5TUBM4PjL9mIru3 EToo9irf3g4qBqE8vtfJDUAz0zj0WdropGxKNSuXa8ZFnmlrhQ0ZswMw79k1cwV0s2L0 X4ow== 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:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=VZ3IkQbygRTwyYroCq9yMH6l+56rDZQ2eBK3vrwxlqk=; b=RCgs9OWlakUmVaH42W1K9hGeLQ2d/euKmLXURjY0RWp4ykGXrBmbil+hLcBAEaBIeW J0ycb86vFU5sbDfXl8KQojPY+7TurA2y9cQyHwLCzsgzdUvPhFhQ0B3/FcYgeO3/c/JU CpvVeC0x6PyvP4HArqm3X7ueY1rvJDLlyD508qxn+MGhRMY7PexndnzO1LFJppyDgLDC Zb3OvwCNyS2F8vbJ6yriECpCVpkPYedsInbovPQF6dEO0pdzrFb/YIY9LChQq8Mpu6mr RQVRCS8Kjx9n17FTPz59Vt4aiCDSNjx/8b/5s6JsRWCJUl6JDTwOQiuQWkB7tBy6f5zW 56Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=Kc9rvT3G; 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 5si1120656edp.345.2017.06.22.00.57.19; Thu, 22 Jun 2017 00:57:19 -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=Kc9rvT3G; 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 73D81C21C65; Thu, 22 Jun 2017 07:56:21 +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 F3F16C21CAA; Thu, 22 Jun 2017 07:56:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9BAF6C21CAD; Thu, 22 Jun 2017 07:55:04 +0000 (UTC) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by lists.denx.de (Postfix) with ESMTPS id 27212C21C91 for ; Thu, 22 Jun 2017 07:55:00 +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 v5M7s9k7009287; Thu, 22 Jun 2017 16:54:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v5M7s9k7009287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498118051; bh=uOSMdZ++EKEgek2uNtKReyXfZiKEwpK6qdqH6dCiHZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kc9rvT3GWheHwi43PmsLaHwzgPEECDi3JV9PSLgs1ezjq4G4oQq/LvTHwRACobMEQ 2Ax7Qhq/TmornyRCt0wNGns+bx2BuKAv+FyyI/RrbYisOtPEV68YdWS7M80pyIRXo+ Q5JzSAgXK5LxENAom4aY/HfCMig262dpIkTZee/UsYeY9R+O7YNoqibK5at+jScjtJ HwUKdaavjJF/vvYjwjScISFGSee+jnSb+kRnaDaOC0qTKOExPOax8FbAplykyCW3Yb ubmOiM39CKPzwBSCrjudc6hUGuxQCSrq87akZqtzB3iGdY12x4jHNDscWNSDkKTeMk pKRGvgvJlbv+A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 22 Jun 2017 16:54:05 +0900 Message-Id: <1498118047-11918-3-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> Cc: "xypron.glpk@gmx.de" , Hou Zhiqiang Subject: [U-Boot] [PATCH 3/5] dm: ofnode: rename ofnode_read_prop() to ofnode_get_property() 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" This function returns the pointer to the value of a node property. The current name ofnode_read_prop() is confusing. Follow the naming of_get_property() from Linux. The return type (const u32 *) is wrong. DT property values can be strings as well as integers. This is why of_get_property/fdt_getprop returns an opaque pointer. Signed-off-by: Masahiro Yamada Acked-by: Simon Glass Acked-by: Simon Glass --- drivers/core/lists.c | 3 +-- drivers/core/ofnode.c | 4 ++-- drivers/core/read.c | 2 +- drivers/misc/cros_ec_sandbox.c | 2 +- drivers/pci/pci-uclass.c | 2 +- drivers/pinctrl/pinctrl-uclass.c | 2 +- include/dm/ofnode.h | 4 ++-- include/dm/read.h | 2 +- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index b79f26dbe6c9..6067914e8117 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -141,8 +141,7 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp) name = ofnode_get_name(node); dm_dbg("bind node %s\n", name); - compat_list = (const char *)ofnode_read_prop(node, "compatible", - &compat_length); + compat_list = ofnode_get_property(node, "compatible", &compat_length); if (!compat_list) { if (compat_length == -FDT_ERR_NOTFOUND) { dm_dbg("Device '%s' has no compatible string\n", name); diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 08b3e03b1e8e..87e731dc2b77 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -422,7 +422,7 @@ int ofnode_decode_display_timing(ofnode parent, int index, return ret; } -const u32 *ofnode_read_prop(ofnode node, const char *propname, int *lenp) +const void *ofnode_get_property(ofnode node, const char *propname, int *lenp) { if (ofnode_is_np(node)) return of_get_property(ofnode_to_np(node), propname, lenp); @@ -493,7 +493,7 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type, * #size-cells. They need to be 3 and 2 accordingly. However, * for simplicity we skip the check here. */ - cell = ofnode_read_prop(node, propname, &len); + cell = ofnode_get_property(node, propname, &len); if (!cell) goto fail; diff --git a/drivers/core/read.c b/drivers/core/read.c index 3131e5379c96..c1fe949808fa 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -106,7 +106,7 @@ int dev_read_phandle(struct udevice *dev) const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp) { - return ofnode_read_prop(dev_ofnode(dev), propname, lenp); + return ofnode_get_property(dev_ofnode(dev), propname, lenp); } int dev_read_alias_seq(struct udevice *dev, int *devnump) diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c index c96e26e6b782..5924adee4085 100644 --- a/drivers/misc/cros_ec_sandbox.c +++ b/drivers/misc/cros_ec_sandbox.c @@ -197,7 +197,7 @@ static int keyscan_read_fdt_matrix(struct ec_state *ec, ofnode node) int upto; int len; - cell = ofnode_read_prop(node, "linux,keymap", &len); + cell = ofnode_get_property(node, "linux,keymap", &len); ec->matrix_count = len / 4; ec->matrix = calloc(ec->matrix_count, sizeof(*ec->matrix)); if (!ec->matrix) { diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index b36ef3338ceb..922401f2a015 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -763,7 +763,7 @@ static int decode_regions(struct pci_controller *hose, ofnode parent_node, int len; int i; - prop = ofnode_read_prop(node, "ranges", &len); + prop = ofnode_get_property(node, "ranges", &len); if (!prop) return -EINVAL; pci_addr_cells = ofnode_read_addr_cells(node); diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c index 02e269020df5..114952a1da36 100644 --- a/drivers/pinctrl/pinctrl-uclass.c +++ b/drivers/pinctrl/pinctrl-uclass.c @@ -134,7 +134,7 @@ static int pinconfig_post_bind(struct udevice *dev) * If this node has "compatible" property, this is not * a pin configuration node, but a normal device. skip. */ - ofnode_read_prop(node, "compatible", &ret); + ofnode_get_property(node, "compatible", &ret); if (ret >= 0) continue; diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 149622a0b2c9..1c507c9f1688 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -463,14 +463,14 @@ int ofnode_decode_display_timing(ofnode node, int index, struct display_timing *config); /** - * ofnode_read_prop()- - read a node property + * ofnode_get_property()- - get a pointer to the value of a node property * * @node: node to read * @propname: property to read * @lenp: place to put length on success * @return pointer to property, or NULL if not found */ -const u32 *ofnode_read_prop(ofnode node, const char *propname, int *lenp); +const void *ofnode_get_property(ofnode node, const char *propname, int *lenp); /** * ofnode_is_available() - check if a node is marked available diff --git a/include/dm/read.h b/include/dm/read.h index 8c9846eaf26f..562881962a64 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -389,7 +389,7 @@ static inline int dev_read_phandle(struct udevice *dev) static inline const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp) { - return ofnode_read_prop(dev_ofnode(dev), propname, lenp); + return ofnode_get_property(dev_ofnode(dev), propname, lenp); } static inline int dev_read_alias_seq(struct udevice *dev, int *devnump) From patchwork Thu Jun 22 07:54:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 106185 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2331456qgd; Thu, 22 Jun 2017 00:55:39 -0700 (PDT) X-Received: by 10.80.166.101 with SMTP id d92mr1609671edc.132.1498118139627; Thu, 22 Jun 2017 00:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498118139; cv=none; d=google.com; s=arc-20160816; b=SejFuhi5fMU2rwH8/fft4qbXNYS5MMDfrIeIA0ZG2sE23YhCtk4j3VkOF0xG8vxpG/ Etx5QSkmklN/btWkwiO6rKVzcPXuMhfRSTbG7+QuzYcwPNksMxfCNRPbFyVAeoB6OZP7 vOkcxgoJk/6AhuVqSZuki6ag4gMvNpuq1A7rqYa0octfYjgsmq4o7nddRBk1pi8SzsjQ pLFYsixz3BDZ82SIRB1eBb8qxif06uyJAdaXTW6SpONi4JDByNxfLwbLDMbHnjX5oVZH AdSURQcPTEb4CaDvQx7NBB6Pyq7+0umrm1ALRrZB7adoAAv4fHZL/nR9PklA0zOIlYLr aQeA== 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=gdl1HRsnszr+orr5JhmhtyMhsBYF4ChY5DeO2KZNPwY=; b=q9i4J0bNK20tnnPJsimXdObvV3C/1Ckc8JIjMGsj6jgtQBLhUxQZtEUY2bWu2NPOFF ZookC0H0jo7fW8k83XRLYhxevnjdB9PVRXT36FlKlRA1GfN5ABz1FNJbkJ7ecTwZXi9Y D0bP7HZVmYAg12IpQ33khb+2JxPtDx3XPKNGZ/0kxYY2j1rB/JclIIgR5/ytBCpAnP9p sFkG/dwGW8yZIHOhI26uZek7dU52MMcBBqQmu75vvedZ6/DDBpqFvl7lIXW/gmbf32w8 eWxNaQVk2dXTim6QJVTPNfbCx3R1g8sblyfw1PHRI88NTPmHVQFbUf4xpPs8W1dU6mgH qb4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=a62wJnsV; 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 e11si1008900edc.142.2017.06.22.00.55.39; Thu, 22 Jun 2017 00:55:39 -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=a62wJnsV; 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 37E71C21CC2; Thu, 22 Jun 2017 07:54:53 +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 52290C21C77; Thu, 22 Jun 2017 07:54:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 207E3C21C63; 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 408B4C21C66 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 v5M7s9k8009287; Thu, 22 Jun 2017 16:54:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v5M7s9k8009287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498118051; bh=jOUG+1yZLAKAilMKziqXMx93zo7VFTxzZ8tqmvDKcaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a62wJnsVvvMLdH/bDRONby6mufZCUkuuJhiunLLXTDz2JBKtqhnHr2ngg85OuXZU6 Q+KzQQvWI8Y0IKVNfRDnyGKjPrk4lQxatTKx53fIDoXCzKfhQZ71nAY7TAR5gl7zAO gKlmxoev5bZ/9r7jIa3Y0yTrnxmOL7GNs9s8hmfSxBuWfLS8JYyObzTUhAIXuNtYSy fL2UKUCa6m0+nosLqBfJbyCsizPzcwm/sRtSFyh2+qBbqzzbUnV0eOUylBBce2DHgY 6tZuahMS4pxj3mBEn5JJVdCaU5YTgPEBou0jIH9JuV3qaCi9Cp0jYAfkRkoNw/7ieB LoCBn8EpWDVwQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 22 Jun 2017 16:54:06 +0900 Message-Id: <1498118047-11918-4-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 4/5] dm: ofnode: rename dev_read_prop() to dev_get_property() 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 previous commit renamed ofnode_read_prop() to ofnode_get_propery() and fixed its return type. Likewise, rename dev_read_prop() and fix its return type. Signed-off-by: Masahiro Yamada Acked-by: Simon Glass --- drivers/core/read.c | 3 ++- drivers/input/key_matrix.c | 4 ++-- include/dm/read.h | 9 +++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/core/read.c b/drivers/core/read.c index c1fe949808fa..61fda9334a7c 100644 --- a/drivers/core/read.c +++ b/drivers/core/read.c @@ -104,7 +104,8 @@ int dev_read_phandle(struct udevice *dev) return fdt_get_phandle(gd->fdt_blob, ofnode_to_offset(node)); } -const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp) +const void *dev_get_property(struct udevice *dev, const char *propname, + int *lenp) { return ofnode_get_property(dev_ofnode(dev), propname, lenp); } diff --git a/drivers/input/key_matrix.c b/drivers/input/key_matrix.c index cd5bce361356..3669019cb9ff 100644 --- a/drivers/input/key_matrix.c +++ b/drivers/input/key_matrix.c @@ -144,7 +144,7 @@ int key_matrix_decode_fdt(struct udevice *dev, struct key_matrix *config) int proplen; uchar *plain_keycode; - prop = dev_read_prop(dev, "linux,keymap", &proplen); + prop = dev_get_property(dev, "linux,keymap", &proplen); /* Basic keymap is required */ if (!prop) { debug("%s: cannot find keycode-plain map\n", __func__); @@ -158,7 +158,7 @@ int key_matrix_decode_fdt(struct udevice *dev, struct key_matrix *config) if (!config->plain_keycode) return -1; - prop = dev_read_prop(dev, "linux,fn-keymap", &proplen); + prop = dev_get_property(dev, "linux,fn-keymap", &proplen); /* fn keymap is optional */ if (!prop) goto done; diff --git a/include/dm/read.h b/include/dm/read.h index 562881962a64..74d5490ad2ce 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -227,14 +227,15 @@ int dev_read_size_cells(struct udevice *dev); int dev_read_phandle(struct udevice *dev); /** - * dev_read_prop()- - read a property from a device's node + * dev_get_property()- - get a pointer to the value of a device's node * * @dev: device to check * @propname: property to read * @lenp: place to put length on success * @return pointer to property, or NULL if not found */ -const u32 *dev_read_prop(struct udevice *dev, const char *propname, int *lenp); +const void *dev_get_property(struct udevice *dev, const char *propname, + int *lenp); /** * dev_read_alias_seq() - Get the alias sequence number of a node @@ -386,8 +387,8 @@ static inline int dev_read_phandle(struct udevice *dev) return fdt_get_phandle(gd->fdt_blob, dev_of_offset(dev)); } -static inline const u32 *dev_read_prop(struct udevice *dev, - const char *propname, int *lenp) +static inline const void *dev_get_property(struct udevice *dev, + const char *propname, int *lenp) { return ofnode_get_property(dev_ofnode(dev), propname, lenp); } From patchwork Thu Jun 22 07:54:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 106187 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp2331757qgd; Thu, 22 Jun 2017 00:56:42 -0700 (PDT) X-Received: by 10.80.137.36 with SMTP id e33mr1586501ede.67.1498118202127; Thu, 22 Jun 2017 00:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498118202; cv=none; d=google.com; s=arc-20160816; b=N+ureJVIRzrXHChUbhExiegxMT1EhlaLqbbzBkHRW5i7HJ+wpUns1wWtaQ6sfR4xAU Jvqnmq1cimfbUHcFyMzzrMPN6APMLAeAuskfMAYonsN9Gjqav4/O+YwD06iVSRi+Naq9 vjjchyQ9KaKsJ6qPoOqJM+U0HLPxfv/TcRYtNd1twfJRTeS9HqPkkYjaWmuFNaPB9vLo fGxAn84lQb/+sEgoaI24y0uRR4fij2qk9PO0pmOaTuM9Mb2JlXt0jOVLuZB6JnUENBIM BDdhOL5J/O18Abo/Xczp1EiHtqj8iChrkw9Gcp6CDLBDoMUsYCTcpqZoUkVnR1fkw8Mn P1Vg== 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=iY0I//MBBGxTYEmOIxJ3ovAxIWC8Qn/z/KJU5rJM9dY=; b=R9AqEkd6O/9IvVkJCL2ELD6Yqduu4UOmYwNEBkMfbft3nFTCWDMUbN7jGa5qmGLxwf 3ZvPwxJIxeHIE7za097DXKZF34qqtpgRFQPmIdZ+vWjv8390mghhy6PsFhP/Rm913snQ 2bUx9ArlrlFjrUftHLTjwB1ayBEZg05G0IJDZx4zlUwr9/VlOWtdoUEcdKWI0w1Jek/4 PdD6O8oxb/MDyJVh6uVURqPGuoQWNQSDnbi9o7/TylqcOgWNOU0tWDqIwU/sPjAGewBJ 2jx1qVCrVua+rr69pG/M0q2BLIai8vVbdwiefvJuG5dIB4CZWTccoMtPfB5E3xSRIGqu rzAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.b=pQowAjtR; 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 f25si95541edc.261.2017.06.22.00.56.41; Thu, 22 Jun 2017 00:56:42 -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=pQowAjtR; 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 9CC82C21CCD; Thu, 22 Jun 2017 07:55:23 +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 4E7EBC21C9D; Thu, 22 Jun 2017 07:54:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 463EAC21C3E; 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 331C9C21C55 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 v5M7s9k9009287; Thu, 22 Jun 2017 16:54:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v5M7s9k9009287 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498118052; bh=N280b5mDGoIkUPOn2PU0e++aQhgVYp1x3MGVFb92pio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQowAjtRn7RpwwEx2lsh5wK/pma+QY+goy9+4TnNFYQ8Ds2BYh7ONUMlYuuV7tz/s TKXuL3JY1XBT+5K0A0dMvK2cGho3x5gT/9fdEkwdRvVzs0pEJD6pgIetrXe6o4itXS brd9Y59FJOk1ZX2Bv7U1oOQpysM+mFeVyibGa/g0ZgDcgqm9mLN/CTkgQNzMa7TCJF p8GbtZ5dAk7DDbExfs9bkzhMRJbGzqIM3VrDBSOsdlyhLPiNQHuO0M3FwUhKFNPc6q 6JziHxZVjutauZZN40FtyHMMzn15JdHPbuAQN6+vz5phQuc9cfNNMCHZEzEIOiuNWP x2AzLHNAgvxjw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 22 Jun 2017 16:54:07 +0900 Message-Id: <1498118047-11918-5-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 5/5] dm: ofnode: simplify ofnode_read_bool() 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" Reuse ofnode_get_property() to simplify the implementation. Signed-off-by: Masahiro Yamada Acked-by: Simon Glass Acked-by: Simon Glass --- drivers/core/ofnode.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index 87e731dc2b77..5a3e1d452fbb 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -57,20 +57,16 @@ int ofnode_read_s32_default(ofnode node, const char *propname, s32 def) bool ofnode_read_bool(ofnode node, const char *propname) { - bool val; + const void *prop; assert(ofnode_valid(node)); debug("%s: %s: ", __func__, propname); - if (ofnode_is_np(node)) { - val = !!of_find_property(ofnode_to_np(node), propname, NULL); - } else { - val = !!fdt_getprop(gd->fdt_blob, ofnode_to_offset(node), - propname, NULL); - } - debug("%s\n", val ? "true" : "false"); + prop = ofnode_get_property(node, propname, NULL); + + debug("%s\n", prop ? "true" : "false"); - return val; + return prop ? true : false; } const char *ofnode_read_string(ofnode node, const char *propname)