From patchwork Wed Jan 31 05:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 768640 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2098.outbound.protection.outlook.com [40.107.113.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57C543D547; Wed, 31 Jan 2024 05:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.98 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706677521; cv=fail; b=Yhdd1HvqeMTUcPI9fknJusadK8QqHDzsNeL+Hdxk51z1wb6pzA0qa/MDQF/L0nD3sPp0XNdU6KEhYh6IXz0QjFP+lm4d/D27Ma9ya0uRP9RGORP/fsj2Q/K9F3eqE6Jte6E/s2sshCwveMY/cJ62dG4C7tEeBg8+RHvlu+KD8lQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706677521; c=relaxed/simple; bh=jyswaY2wEnowBh7alcyEOtjxy2Vcjt9t0eWSOcbUkkg=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=l1tgY4lejWAH2bYNhTFryfgoVNoNKSOEkgECUjbxcvN9984pBkN/Ay6MXsGUTL30Lc/iP1SDJBQ2RnaqpEsZwGBYVGgJmvlIb2J9ZkUcJnl32INQO0kp3eF74GHYToLr2sto8pSjIg43Josst8myUZ/8jQBMoUcTyel+TV+Lanc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=i3xggJMA; arc=fail smtp.client-ip=40.107.113.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="i3xggJMA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LFX4TLibtpgyxXP2xT0wXnHiZPMvUKqeEz0cKDGAqPkfSOR2nURLc132YnIl0SXgfx3sKZifmF3/dTCh9y1zjh8SFZQsKB3SHkM1/+LIr3KGwb4NuUD6NGJsx6MDJE1FGEqBFqoehu8J6DVB1kIo1lDdxhV4oPKlpIeUzTAAixG69F+OIhos7lAzmQCDqt2um25DMnDFyZDhqLe9Rl4Ak8+k99cZttIcCKm64ZtOAyWvcaUBkvCiEe5Nvwf5IkN/PsSqU7PY8Xeegf0E2xpc124d8KbAs8yGDhF8ISgUGlFc4G1Woaj7AdTSMls9EjU1LsMGUD6xoNkkIxbpZ6tV8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GVCSpQ6Gm13JFsk4yudxcp9izZkrD44WheCtk80q3Wk=; b=lA6ONlPZ/yjGaxfQJ9pyeOIxhxfAFF91Cfsgc36BjVIwKKHUwjJlF55kjUsIx3gD3FcdXEUZbFuRvW3zfCN58CtApTMvrpm3iW6Vm3jBdyCj2XOr0KZjJHljwsYkj08iHIVu5tyQMMffSbHRl0BPC8gZfKDdPxibHlOwtAH0FF6HQrjcl5H0j8g5ydhC7Pq7qlZIymSmTLSxJtNzC42wCLi+o11ygenTn49NKApoVRDuyEWicrcnFtvMd2Tt9wjL4gaKA+aQUTugnym2mxEDbMVVp1muAhXRD1kYgqTlb4YYiBWepmGxSbg5qkUUS5A3iQanl7nqUDqgSVz6I6vt8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GVCSpQ6Gm13JFsk4yudxcp9izZkrD44WheCtk80q3Wk=; b=i3xggJMAmSAvzRuDGmR2EF0JG/1B0Uy96n3OhnlSdlBcJdqtwEyxVLZfcbTqpDaS49wwSQzle7Hgucvdakbm9VkDbCiV8HLoRe/XVLt5QIGhCbuDpPXrEcHgRqG9HjqV8CLDFxHOUtrJxoCIk/JRLSt2UMIGZD6ZQHUUiRnbNtE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB8341.jpnprd01.prod.outlook.com (2603:1096:400:15c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Wed, 31 Jan 2024 05:05:14 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.023; Wed, 31 Jan 2024 05:05:14 +0000 Message-ID: <87jznq6qk6.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: "Bryan O'Donoghue" , "Lad, Prabhakar" , =?iso-8859-1?q?=22Niklas_S=C3=B6d?= =?iso-8859-1?q?erlund=22?= , =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Abhinav Kumar , Alexander Shishkin , Alexander Stein , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Andrzej Hajda , Andy Gross , Biju Das , Bjorn Andersson , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Dmitry Baryshkov , Dmitry Torokhov , Emma Anholt , Eugen Hristev , Florian Fainelli , Frank Rowand , Greg Kroah-Hartman , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jacopo Mondi , James Clark , Jaroslav Kysela , Jonathan Hunter , Kevin Hilman , Kieran Bingham , Kieran Bingham , Konrad Dybcio , Krzysztof Kozlowski , Laurent Pinchart , Laurent Pinchart , Liam Girdwood , Liu Ying , Luca Ceresoli , Maarten Lankhorst , Marek Vasut , Mark Brown , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Michael Tretter , Michal Simek , Miguel Ojeda , Nathan Chancellor , Neil Armstrong , Nick Desaulniers , Nicolas Ferre , Philipp Zabel , Philippe Cornu , Raphael Gallais-Pou , Rob Clark , Rob Herring , Robert Foss , Russell King , Sakari Ailus , Saravana Kannan , Sascha Hauer , Shawn Guo , Sowjanya Komatineni , Stefan Agner , Suzuki K Poulose , Sylwester Nawrocki , Takashi Iwai , Thierry Reding , Thomas Zimmermann , Tim Harvey , Todor Tomov , Tomi Valkeinen , Yannick Fertre Cc: Alim Akhtar , Fabio Estevam , Jacopo Mondi , Jernej Skrabec , Jerome Brunet , Jessica Zhang , Jonas Karlman , Laurent Pinchart , Leo Yan , Marijn Suijten , Martin Blumenstingl , Mike Leach , Sam Ravnborg , Sean Paul , Tom Rix , coresight@lists.linaro.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sound@vger.kernel.org, linux-staging@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, llvm@lists.linux.dev In-Reply-To: <87o7d26qla.wl-kuninori.morimoto.gx@renesas.com> References: <87o7d26qla.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH v3 03/24] of: property: rename of_graph_get_next_endpoint() to of_graph_get_next_device_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Wed, 31 Jan 2024 05:05:13 +0000 X-ClientProxiedBy: TY2PR01CA0023.jpnprd01.prod.outlook.com (2603:1096:404:a::35) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB8341:EE_ X-MS-Office365-Filtering-Correlation-Id: 29980f97-1af4-43e0-e3e6-08dc221a35ad X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tNCfMt2rVvIvnhrk0CfwGnYl6Fcx5wi5leYgkzk4ZMS4cmuq9VyNO6bnUDuwaekzmIsMUh9jL9mH0XKa+2IPE6D1iVIfz8yA/A/e9GCrlv5RQR0q0v1IhY3LMJm23G7sCg9C5T+2BIQNykiyXicCQPkjzDXFBoroW2IkTgXMibWFxWfSjKvb0bZ33uOfcKgeqI6vnPv8LVEwx3QMEVpC0iYHnpHsxc0Yoq7FVyjUmimrE2ZCCvnrGvar4yTyhUOz21n+0B5H+stBXqeXl/fDjRc3Ta1l2H4F07Qv15oCcuWzxHBDRCIDR0T6NI9LK168jN+ybdo53r3KclYSdlq3C5NBiwXFo96Fzos/IUcO46VmuRQsNlJBx0c5dZT2oIQJKN9QSUKAN0kuYAYSfaKZLwHoU2Sj565ZaWJB+/7pr+desmG5/9DBGPCK+JmEm132hrY9By2QHo4u4+JwgkiboyuNknHRKhmE2wYIZ/lllqErUsz4MCm+JmAXCC4onms50D0ZSvBo0+AWnPgWQlroeTVKyKAWCRKjZ9GeRXj4VeQHSbBBQXECZ+/kIk4ITAEF1J7TTVbPaGV+QLOB55BH8OwAbiB5B163wylNd4/UxSBW9E5YLw4b7NX1/MVUpjDGFv2pLo6J+/GCj0gioe/6TA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(346002)(136003)(366004)(376002)(39860400002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(1191002)(66476007)(8936002)(4326008)(8676002)(7366002)(5660300002)(2906002)(7416002)(7276002)(86362001)(7406005)(110136005)(66946007)(7336002)(316002)(38350700005)(36756003)(54906003)(38100700002)(66556008)(478600001)(52116002)(6506007)(6512007)(6486002)(83380400001)(26005)(41300700001)(921011)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PbFn/JVHmH9FGEWy0j/dBIlNiuoPXsCC7Kq6IQ8XKcad6yP13wDbMeH0bVbuoq9zwWqIi4EmUrIJrRf5k7TyYgDgg+mJjQQavooPAiCmiu67m5xvzY+8yxV3s5x6mZS9v1nCa/mAkfvlusblNp6mxfDgZUl2Y9cbcDx21BAlIE8bDPfN6Wljt8cqgzikookGk9mouZ8XqW8R+V4im9n2+22H/5HYXP+K7wz+JZH5odfNRxK1jptIcOHuudMqmRUelqpAOWPc3t2batAKDhTULgomOUEU4/ZmHdXe8L2KqKj5bUAUnbIBy7xHxuoZX5CLWM0wd+aHIPYO+LL7sb9VLcP970+1GKZigA9CMEHpuD3+gcKxirnFy81fmltEqjs8Ews2w1wtwMOi2qak1P5x86N9CKl70+wgpU7tEA3AwHQDq9ZYeT+SVs1Y8M7JlnNbzmeK3gYDoNZ+Cxv80xQ+myKbWTCFed5J8cUC0WF/Fg9S22zTvxGtt4/IAgrLixvI5TA9vS08W63eLFnsHpodOdW/mTneHuBgwkXQX0et/+Jc87EINutKbbu3OjHb1JNNYgGEfTeGRcF4IC28Cp+Z7khIOZKOL96ix4LeMkcY/Bzd2/syQFn6BUINoBncO8rvsY/Ta0zyymMa+uIFQ6oxVCxRW7qV5UixVZMy48uv/0sUULudPWvFFS5waUibCihoDOmTGVAPjv8v86WXrlt2VWNA/zyfchl3M3mg3Z9Nd0uAmtAYERBwnVDVRfQHoG/EldcBl4wDD7KhvnA6bXpt0JwkdBcHRh+zSKRSECqPLJxhWmmcX46Qiko0Y2FjmCN/VwWQqAGJVbiTAzy0A1fsJWacNDX7bMHBCKqDxq0Qix/T7mdiuFrkbpDwE8ZOLBZ8nzv+/1VgtabliNV31iiwBY1PpRDr0JrtFKqzDQp48XPa2pAdUwDJ6BzwgdTK97iQ3iJIPFF9047eNDnlrnggEfxx/NQSPceiKU451QC9OEjx8RuP0O14r0ZYgbIC9ESVpH58vXL8b1S3neRcThVBM4cmCixJqZVkV6kl0LJWGgJxQrIvVLsVnFcR2ghWxesgRYejuwKLrLhMG04B6BjspqdoTMAIohXM6KPI+e5DuiUE5ila4kSfGUZRNvg3mAD+d4F0AU9lqQZBX7B+BxbbKo9qSTqOG7CIUYJHtUZxE1n8eEJXvcN0BmCgJ7JwTljNj58C/evX0GynHx0matxBpWALPmTP/nYbxS2KRz/AYGEf1w/eJ7w2agpAz4DIOMql+9b2255RX1+ZTIo4W695WlvcTKXqsN/StGUUJ73biWvvXud13GMNqbJUTo9Lp8Ze6cobgH1XR9wdfTWwfFXH9jI4zRAh/C+Kwqm8Tn5kG5x+dVc+zD+lVD7lz2ZX3oTLCBVm28rDebnxB+lgWsH0ClytZA18AKC8AtLb8irbWvYBMMyx5+A7Iq/H2ugexfTQPG9g5CT+vnsX/2dolgvtJPiqVw75ID8wLoQTOODYGrT66FhygZ/YSJ9bu9IFruwDCTlU/dIZahMtWY8PBbij4jLTL+hu4ojNtGNRQUEJ2Zo3uwzBWIsPj1B2FofsJTGzRBvw3XzvXamKlgRc+/IaVT+iJJhvhTzXLVKpIIXn874= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29980f97-1af4-43e0-e3e6-08dc221a35ad X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:05:14.5926 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ttaYoRAqWdkLLa7gGHzwcvTo4Hyxd+l66+ybjg1qgkR9GgCW7VRVScBycGjkhM2EIwgsf9j47RDiR/Gc6zeW1bGZX7wSBKy4J/suHchl7YyJAVCBv8CdCJurbQM3XrpG X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8341 Current of_graph_get_next_endpoint() will get next endpoint. ports { port@0 { endpoint@0 {...}; (A) endpoint@1 {...}; }; port@1 { (B) endpoint {...}; }; ... }; If it reached to end of port (A), it will get next endpoint from next port (B). This behavior is not intuitive to user. User assume it return NULL after (A) from this function name. This function gets "endpoint" from "device" one after another instead of "port". So let's rename related functions as of_graph_get_next_endpoint() -> of_graph_get_next_device_endpoint() of_graph_get_endpoint_count() -> of_graph_get_device_endpoint_count() for_each_endpoint_of_node() -> for_each_device_endpoint_of_node() Signed-off-by: Kuninori Morimoto --- .clang-format | 2 +- drivers/of/property.c | 24 +++++++++++++----------- include/linux/of_graph.h | 23 ++++++++++++++--------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.clang-format b/.clang-format index 0bbb1991defe..e8ca6d577073 100644 --- a/.clang-format +++ b/.clang-format @@ -231,6 +231,7 @@ ForEachMacros: - 'for_each_dedup_cand' - 'for_each_dev_addr' - 'for_each_dev_scope' + - 'for_each_device_endpoint_of_node' - 'for_each_dma_cap_mask' - 'for_each_dpcm_be' - 'for_each_dpcm_be_rollback' @@ -243,7 +244,6 @@ ForEachMacros: - 'for_each_element' - 'for_each_element_extid' - 'for_each_element_id' - - 'for_each_endpoint_of_node' - 'for_each_event' - 'for_each_event_tps' - 'for_each_evictable_lru' diff --git a/drivers/of/property.c b/drivers/of/property.c index 25d73409aeee..007729d66972 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -632,15 +632,17 @@ struct device_node *of_graph_get_port_by_id(struct device_node *parent, u32 id) EXPORT_SYMBOL(of_graph_get_port_by_id); /** - * of_graph_get_next_endpoint() - get next endpoint node + * of_graph_get_next_device_endpoint() - get next endpoint node. If it reached to end of the port, + * it gets next endpoint from next port. + * * @parent: pointer to the parent device node * @prev: previous endpoint node, or NULL to get first * * Return: An 'endpoint' node pointer with refcount incremented. Refcount * of the passed @prev node is decremented. */ -struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, - struct device_node *prev) +struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent, + struct device_node *prev) { struct device_node *endpoint; struct device_node *port; @@ -696,7 +698,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, } while (!of_node_name_eq(port, "port")); } } -EXPORT_SYMBOL(of_graph_get_next_endpoint); +EXPORT_SYMBOL(of_graph_get_next_device_endpoint); /** * of_graph_get_endpoint_by_regs() - get endpoint node of specific identifiers @@ -714,7 +716,7 @@ struct device_node *of_graph_get_endpoint_by_regs( struct of_endpoint endpoint; struct device_node *node = NULL; - for_each_endpoint_of_node(parent, node) { + for_each_device_endpoint_of_node(parent, node) { of_graph_parse_endpoint(node, &endpoint); if (((port_reg == -1) || (endpoint.port == port_reg)) && ((reg == -1) || (endpoint.id == reg))) @@ -812,22 +814,22 @@ struct device_node *of_graph_get_remote_port(const struct device_node *node) EXPORT_SYMBOL(of_graph_get_remote_port); /** - * of_graph_get_endpoint_count() - get count of endpoint + * of_graph_get_device_endpoint_count() - get count of endpoint * @np: pointer to the parent device node * * Return: count of endpoint of this device node */ -unsigned int of_graph_get_endpoint_count(const struct device_node *np) +unsigned int of_graph_get_device_endpoint_count(const struct device_node *np) { struct device_node *endpoint; int num = 0; - for_each_endpoint_of_node(np, endpoint) + for_each_device_endpoint_of_node(np, endpoint) num++; return num; } -EXPORT_SYMBOL(of_graph_get_endpoint_count); +EXPORT_SYMBOL(of_graph_get_device_endpoint_count); /** * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint @@ -1017,8 +1019,8 @@ static struct fwnode_handle * of_fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode, struct fwnode_handle *prev) { - return of_fwnode_handle(of_graph_get_next_endpoint(to_of_node(fwnode), - to_of_node(prev))); + return of_fwnode_handle(of_graph_get_next_device_endpoint(to_of_node(fwnode), + to_of_node(prev))); } static struct fwnode_handle * diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index a4bea62bfa29..80b7a579e96a 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -26,25 +26,30 @@ struct of_endpoint { const struct device_node *local_node; }; +/* REMOVE ME */ +#define of_graph_get_next_endpoint(parent, previous) of_graph_get_next_device_endpoint(parent, previous) +#define for_each_endpoint_of_node(parent, child) for_each_device_endpoint_of_node(parent, child) +#define of_graph_get_endpoint_count(np) of_graph_get_device_endpoint_count(np) + /** - * for_each_endpoint_of_node - iterate over every endpoint in a device node + * for_each_device_endpoint_of_node - iterate over every endpoint in a device node * @parent: parent device node containing ports and endpoints * @child: loop variable pointing to the current endpoint node * * When breaking out of the loop, of_node_put(child) has to be called manually. */ -#define for_each_endpoint_of_node(parent, child) \ - for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ - child = of_graph_get_next_endpoint(parent, child)) +#define for_each_device_endpoint_of_node(parent, child) \ + for (child = of_graph_get_next_device_endpoint(parent, NULL); child != NULL; \ + child = of_graph_get_next_device_endpoint(parent, child)) #ifdef CONFIG_OF bool of_graph_is_present(const struct device_node *node); int of_graph_parse_endpoint(const struct device_node *node, struct of_endpoint *endpoint); -unsigned int of_graph_get_endpoint_count(const struct device_node *np); +unsigned int of_graph_get_device_endpoint_count(const struct device_node *np); struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id); -struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, - struct device_node *previous); +struct device_node *of_graph_get_next_device_endpoint(const struct device_node *parent, + struct device_node *previous); struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg); struct device_node *of_graph_get_remote_endpoint( @@ -68,7 +73,7 @@ static inline int of_graph_parse_endpoint(const struct device_node *node, return -ENOSYS; } -static inline unsigned int of_graph_get_endpoint_count(const struct device_node *np) +static inline unsigned int of_graph_get_device_endpoint_count(const struct device_node *np) { return 0; } @@ -79,7 +84,7 @@ static inline struct device_node *of_graph_get_port_by_id( return NULL; } -static inline struct device_node *of_graph_get_next_endpoint( +static inline struct device_node *of_graph_get_next_device_endpoint( const struct device_node *parent, struct device_node *previous) {