From patchwork Fri Aug 9 04:22:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ADB2FC3DA4A for ; Fri, 9 Aug 2024 04:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yxYZARE5YIAVlLCOn5vCZq4OcG85LHMVzjMRxhWqpK8=; b=EQSeOrKb9qf5DwP6vFsjZgscGn I9ObnuyNqWeKBbxOBDSAGH3BL+JlJLPWr1yd8qpk43AFC4/50J8IVJBo4guV1RjGWAsBpu//y/ErB ri0gBv0tFdZI6GCSStPXmSkmGZ1KrvfAJtK3yYGFvGzneLXWRqrIrttP4rQckSIcwdgG6fuIaediT uxuF3gUT1JlyqigCf+lBfk9QU8hgsuQy6jcBcDFh3VSJ838VmPQmDrpW8MOPwPv05qi/ca3g3iRdx chMx1tEUy65ZpKIyDzSyUMLQ8matEvFmeB3mKzaMeC2qwaf7F0OHnhHaepTr9JY34Izk+JxWyJ1O1 HX5UdCOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9v-0000000ACjQ-2g6u; Fri, 09 Aug 2024 04:23:23 +0000 Received: from mail-japanwestazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c406::1] helo=OS0P286CU011.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH93-0000000ACTf-06MD for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:22:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dhIFhOwskAwoFI+qrERNqHSlNtW3nNf6GovlmC7GIFE7rxDZ39XWznUADsia9K22bFRyiBKuHBOyhU6X0Uko6cTcNRz3PLDanvAEG6GogwuQ992VVWkPgwrPedWAmHgCzE7SrNk1I+NLmXK3L2oNWf3Zvy47RX47M0aOer7FrE7v+nvhqOaAqrn+fUWAidIh+rr3nQ055XZW62KozNu4lzlW6wZDU0BA2sFOfbmYfWVeTPJUd7eL4YUZNlb2unxI+BxPFSIEj+vnUa60mxMFGZ8w4BtBnqVgYJptHXulIoC1nmbjrw+1EHwKo4uW5BwcrV/3II+8hCDdLPcZ/Y6Znw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yxYZARE5YIAVlLCOn5vCZq4OcG85LHMVzjMRxhWqpK8=; b=sUTKHb2OIJEQreRaxN8bXQ8b6CU2H/H7kK7qlyVg0p388Gl8DLbSTypYy9f6NkFS0KACBXZ7GexmqAZjBUeVpvrCWzIfuQecO9gSTQs/LjzYzkcKDupqXumrLNosTxjQztO+WT3BJBpAhoF7Ff3g4HuacKV56/bDhwwP4HHjE5ELI5iPC7zcDNDTek3sPFHB9BItKmQc7INRFKCzBPdfuUZtkhjoYIX14+FEJac9rSTpdtUqF+k/7MRZmz1bMn9SI4Ceu86LD9hGh35RMPV+BdssGfmYFLCVQ84VgtS5vyqI9mTfyd9s6WHG0k19jImdbnXqQ9fdmznWaiZn6rCucw== 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=yxYZARE5YIAVlLCOn5vCZq4OcG85LHMVzjMRxhWqpK8=; b=LgLLO/yc3VW00kqYwaP/LJs/nirzvao+wbb+QkC5Eq7iwTr4HOU6WunDKlniO1zDiDSeZOYQ/09dS/gApg5BY/CZm8VlsPMvDPj3bb6ahxuX2dW7CnPCkA4T7tTD9lQlfdRSKud40CqDdSkCOVwMDGouepxREC1bOJQvmZGI8ek= 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 OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:22:22 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:22:22 +0000 Message-ID: <874j7u8gw2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 1/9] of: property: add of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:22:22 +0000 X-ClientProxiedBy: TYCP286CA0045.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::19) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: d1cbeb3d-e069-4c01-c282-08dcb82add7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|1800799024|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: dLxi3Cb3W5HPd15o+MIW/6BgnAf3EfNbAOqwlNZbL3udeKrvjXJvrbdnou2CWPl82D7dwxjttQIeYzLKXhb3ZlWE6o2Ok7KNYeESgZvCSEhhNCzNk5kevZ7U80b+p999T6bB9snwTl6yjsAbzqcctVAObHTrldRv6qHWgz/Sj0S+TLd9KKmv1os02BJR62BiiMElAsJrDpIFH9X3hoPw3VrnDVexccl1MgMlEsnsgZA3YEf62Sgy/W3+90Hg8EKcMBS5BQw8aoMrt2+lZhxUZjjLCa7zP+/cJAb6yUvx2d9RqDtb+e6ENu95j9ue1ZBfS2edJT57djCxnxwjuJ7/PsVKwvh/GHMXWRTuB58ZjmMoqRl+jxWPhNvs+zlLv4w4hnXPi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P:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TJ05b5OnsEvmj8cofx8DxYLA1eGTsvPvpcv9pZk0OOn/HEsCvfZZeN70b4EsTgnkU0ucMpjVFQJQzswXhxH3xiOhk/9g5dBYuntP2wHJJCxhFEyLMLfl+utb1taQIqkj4ikN5qJ4TD6jmDvuCaeWCbS60ppclDTBCMgmM/a4+s0aZNY3Cmp3gGV3fKQQk4WnWRCqlfcUbO4qwOx1HPkl8EP5gJLypr/DC3MClCeMsml8SGiSBBb2wYHnOrmz3rB25IaQZfH+hAgBgcGHM1CBqjRqk4ZV4mOxVwf8/+9Q/YQ9AZgUEn2u5l2zub2R2O7rjo+O+SQ/jv43WxCC93rHzdhGu9UsGvTwwrC8r3pfx7cMAPnOUVAGKuZWXV4kI5BrLgJu5uKAMgPlVgTNjEoEzOB01jAOIS0ATACfqtC04JtTVSuCP7vdxAfefiwydz9lMYiNcSjpVx/JMqq4OqeVdPgzsLXaCayuoeDlvUl+pg7ljyXmH/1UUyO5uKF7r3scHLpW4w1OOWL/hVWVQrMJdUfyz0yfgW1W2XU+pYCVL2KUd0wbsW0B+2YpJAM7FJKTco0AxxfzFM4eptZV1TKTuwaSLKYcIbznzJmTq4T2uSR4C03KmLbmJyjKOy8mOOuaqsQUISj3/zluSYxm2WokJa69DSjwZzFQSMciufqYkBE32emVYayw/ndBeUSkdHHsdIKBmXtRjstma7ASeklvr0jYd6vhay/v1vr8pDowa+ZMDQmM4vJeW+byc/ZzE1O7T7WheO277JWccJcEXSWAlBhDuVxwILttoO1lsItPGAjBO919eB7W6uGq0vLhVevM/QDqaElRiTGYIf2dUuIhZLi3tw0jd6yYqD0n4kUze8PuK2axGCcIA+Kwb3QggXGELGzG9XiV20B+Z5CSlt0VJqm9zdkWMluyWyL4LcYVOkdYp0/pYBQvLpDGFu1nqwB70mrX0c4cXq4Ehbj63BjFSbAw1VvcyxCsU45cuCEc9hL5LQtmuy9oCJpH1FBuxc7ngNy4sXtKIMwKEW7LCOfhc9qDmhLm2tlH/umrkwVU+fpULzl3vIcnRW3V3nxa9fNhpxl3HutpGyhC792DIV9eyc1CautMF/aYyuYPcom/OKeKrZ8tdZL8GUFlxIZQWO1iFIBA/uwC7OjCB13YIkIANK4ZbqKL3rkMDXtysbZBPEdptKG57nq90bvBFYTA43T2PFtjYUiIVIpQbVRr0gM2aKnqjchjVop7rLDBfzTBANfLsXDRBAt3VCUkoSPwZfZ8QfN2dHwPtbBmwJTdunQpKNjZQj/RVoS1AcOxbjoFWD/c1A9fIe9Z9OeWB1h7STDKlgDz4yeSUbxVXw3C7nE9reNbsbnwYToHmqfq2co7ledW+6KMRu0A1wwJTwGm215jGmOCq+h8ojm+9HwSNoVMjk6SAfyknG+OfFn+hELy3HxVHteKC0fck9o2krExR+dgqxGOwaVi1wVm4IvoRjFUQt0up72UQnfU6nChNqaYWL98LzdpdL4uO3kLdt1OCY89nHyfwfovuL5/2at6kqwrSyR64wEoBs9wyANyxHzkZL/DJkUXobNvBztLQAg8HVyYxq0CCCkaMDQVQxvdDwUlWAZnLFfaIaQIZ+e4zjpNkyU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1cbeb3d-e069-4c01-c282-08dcb82add7b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:22:22.5227 (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: j2HmD28QVV9bFjfEEcg/WK0T96T2XXqKvKGv8/E9dlYWIE/hgLOIv/8N9iGJ4uD9Q3AMnxGHW0ghcpDZeJJUR9f8uzDhXA7ZCeXBPFrB3NKj3FAagoSrj2fhCDt+DXHX X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212229_193179_C2A36573 X-CRM114-Status: GOOD ( 22.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We have endpoint base functions - of_graph_get_next_device_endpoint() - of_graph_get_device_endpoint_count() - for_each_of_graph_device_endpoint() Here, for_each_of_graph_device_endpoint() loop finds each endpoints ports { port@0 { (1) endpoint {...}; }; port@1 { (2) endpoint {...}; }; ... }; In above case, it finds endpoint as (1) -> (2) -> ... Basically, user/driver knows which port is used for what, but not in all cases. For example on flexible/generic driver case, how many ports are used is not fixed. For example Sound Generic Card driver which is used from many venders can't know how many ports are used. Because the driver is very flexible/generic, it is impossible to know how many ports are used, it depends on each vender SoC and/or its used board. And more, the port can have multi endpoints. For example Generic Sound Card case, it supports many type of connection between CPU / Codec, and some of them uses multi endpoint in one port. Then, Generic Sound Card want to handle each connection via "port" instead of "endpoint". But, it is very difficult to handle each "port" via for_each_of_graph_device_endpoint(). Getting "port" by using of_get_parent() from "endpoint" doesn't work. see below. ports { port@0 { (1) endpoint@0 {...}; (2) endpoint@1 {...}; }; port@1 { (3) endpoint {...}; }; ... }; In the same time, same reason, we want to handle "ports" same as "port". node { => ports@0 { port@0 { endpoint@0 {...}; endpoint@1 {...}; ... }; port@1 { endpoint@0 {...}; endpoint@1 {...}; ... }; ... }; => ports@1 { ... }; }; Add "ports" / "port" base functions. For above case, we can use for_each_of_graph_ports(node, ports) { for_each_of_graph_port(ports, port) { ... } } This loop works in case of "node" doesn't have "ports" also. Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 88 ++++++++++++++++++++++++++++++++++++++++ include/linux/of_graph.h | 46 +++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index 164d77cb9445..e4d5dfe70104 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -625,6 +625,76 @@ 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_ports() - get next ports node. + * @parent: pointer to the parent device node + * @prev: previous ports node, or NULL to get first + * + * If "parent" node doesn't have "ports" node, it returns "parent" node itself as "ports" node. + * + * Return: A 'ports' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_ports(struct device_node *parent, + struct device_node *prev) +{ + if (!parent) + return NULL; + + if (!prev) { + prev = of_get_child_by_name(parent, "ports"); + + /* use parent as its ports of this device if it not exist */ + if (!prev) + prev = of_node_get(parent); + + return prev; + } + + do { + prev = of_get_next_child(parent, prev); + if (!prev) + break; + } while (!of_node_name_eq(prev, "ports")); + + return prev; +} +EXPORT_SYMBOL(of_graph_get_next_ports); + +/** + * of_graph_get_next_port() - get next port node. + * @parent: pointer to the parent device node, or parent ports node + * @prev: previous port node, or NULL to get first + * + * Parent device node can be used as @parent whether device node has ports node or not. + * It will work same as ports@0 node. + * + * Return: A 'port' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_port(struct device_node *parent, + struct device_node *prev) +{ + if (!parent) + return NULL; + + if (!prev) { + struct device_node *ports __free(device_node) = + of_graph_get_next_ports(parent, NULL); + + return of_get_child_by_name(ports, "port"); + } + + do { + prev = of_get_next_child(parent, prev); + if (!prev) + break; + } while (!of_node_name_eq(prev, "port")); + + return prev; +} +EXPORT_SYMBOL(of_graph_get_next_port); + /** * of_graph_get_next_endpoint() - get next endpoint node * @parent: pointer to the parent device node @@ -823,6 +893,24 @@ unsigned int of_graph_get_endpoint_count(const struct device_node *np) } EXPORT_SYMBOL(of_graph_get_endpoint_count); +/** + * of_graph_get_port_count() - get the number of port in a device node + * @np: pointer to the parent device node + * + * Return: count of port of this device node + */ +unsigned int of_graph_get_port_count(struct device_node *np) +{ + struct device_node *port = NULL; + int num = 0; + + for_each_of_graph_port(np, port) + num++; + + return num; +} +EXPORT_SYMBOL(of_graph_get_port_count); + /** * of_graph_get_remote_node() - get remote parent device_node for given port/endpoint * @node: pointer to parent device_node containing graph port/endpoint diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index a4bea62bfa29..a6b91577700a 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -37,14 +37,41 @@ struct of_endpoint { for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ child = of_graph_get_next_endpoint(parent, child)) +/** + * for_each_of_graph_ports - iterate over every ports in a device node + * @parent: parent device node containing ports + * @child: loop variable pointing to the current ports node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_ports(parent, child) \ + for (child = of_graph_get_next_ports(parent, NULL); child != NULL; \ + child = of_graph_get_next_ports(parent, child)) + +/** + * for_each_of_graph_port - iterate over every port in a device or ports node + * @parent: parent device or ports node containing port + * @child: loop variable pointing to the current port node + * + * When breaking out of the loop, of_node_put(child) has to be called manually. + */ +#define for_each_of_graph_port(parent, child) \ + for (child = of_graph_get_next_port(parent, NULL); child != NULL; \ + child = of_graph_get_next_port(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_port_count(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_ports(struct device_node *parent, + struct device_node *ports); +struct device_node *of_graph_get_next_port(struct device_node *parent, + struct device_node *port); 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( @@ -73,6 +100,11 @@ static inline unsigned int of_graph_get_endpoint_count(const struct device_node return 0; } +static inline unsigned int of_graph_get_port_count(struct device_node *np) +{ + return 0; +} + static inline struct device_node *of_graph_get_port_by_id( struct device_node *node, u32 id) { @@ -86,6 +118,20 @@ static inline struct device_node *of_graph_get_next_endpoint( return NULL; } +static inline struct device_node *of_graph_get_next_ports( + struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + +static inline struct device_node *of_graph_get_next_port( + struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + static inline struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg) { From patchwork Fri Aug 9 04:22:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 907CAC49EA1 for ; Fri, 9 Aug 2024 04:24:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yXQQqmUo51ENL/MH4ndFN6momsYZa5Od/gAnQOEoSJ0=; b=C6Oh84tERqAkotaliXGP1PXeNC MRRZcJOzjSlYxKldDlPGQ4rlJCHgXvcNSxu7igIm50rIDm2vfwAKDFUHUWqN5n/uXkPXUr1MP2QhU hnTKfacV/Zoiv8UBXY9JOVrF2DaI6b+d889bju//Fd5l363yo665bTN8sSbzuX8pKMd88F4PKWdvf xDR/i7Roli2gz/Az2MMYXulKuo2708qb9y2fqLeo0/kZYi9AX+h9f3AiJTrz/mN6iU9/WxdWHZkxp ka0VoFuIXKkpMNpBkEyAZap2dg73Qkun40fk9jmUH1RqWxbF+LGxG6mhUwakl/G7mzQcwQJroRxhM qoMsxkOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHAT-0000000ACuR-2xwf; Fri, 09 Aug 2024 04:23:57 +0000 Received: from mail-japanwestazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c406::1] helo=OS0P286CU011.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH94-0000000ACTf-49aO for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:22:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cDEsoSkWM6EeQXu2R7v0b52Q3aUMlE5yemlH8gXt+yJuHZrwyH6e65/+Avhl826z/gTIBfR+TL/Ws5zZj/Cz8AAIHClupK4pM9ep/xczIOoKslEUPbpYhFuEDtsr31AnJsFwE2v5PZsBksMiivcM5tnnLkeWmZOzALsVl3XVm5rKWlVmn1JZolsQpcYp2iyFrbJGQKWOD8cjsErL53GziEpg7E9jMXmZh4hYDk2YPVBi8zpxSwmkGeIpd/2RLwY1/pTmEJKiW3D+l2r04BfntbpFdKy52xE/hJ1bbwfHyQEOF9Z/Wh1aXjWAu/UG3vAXXEzrL7hA1daliTeN7KiK1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yXQQqmUo51ENL/MH4ndFN6momsYZa5Od/gAnQOEoSJ0=; b=WezevS9QeuTSY4AHGOG1aGi9BTeoswJnXrzodQSgvqksijq6fNMy4lG/KUlx99SCLpFKlwvco//ztDCz2FCeSIU3xg6xvW8/Hk4zAXXp0cf+irAXWrbCJ1qNrV68pYakPq6fjlKsaTMA/Ceh4fU5RMohYkq5bM+hvkf8sk1ikjTDQ7qruXLOMJlJGpZnGXs6jMb0PHd9tY4iTT7gnNzgJGwPEdi4EPGmX8raY3ugI0d+2GsWvIi7J103aprFTd+bBNyinLW3YxSri2+yGIARsf7EyImFdox2JP8eybXA3pQ54ZrzHoyAsJE0TH+Rc3dTLypS9/1d07KYR9JWweb3FQ== 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=yXQQqmUo51ENL/MH4ndFN6momsYZa5Od/gAnQOEoSJ0=; b=Vde10mO9qDIm4E3AI1CP0hfg7cA1ESR8lkSqFPtX3Fs5/AYKWiWSUwZMVelQIhyskKBunE5bR+1p/jfR79jWW1yieW3d6u4WdVTO6Hw4Qzunfz6owMtwqENvLQpDTn7PveMbx8FlUioOSVdrObl1pydOhruZX5B5y8SkcsUVKMk= 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 OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:22:28 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:22:28 +0000 Message-ID: <8734ne8gvw.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 2/9] of: property: add of_graph_get_next_port_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:22:27 +0000 X-ClientProxiedBy: TYCP286CA0031.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::6) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: a7cba215-7dd6-461b-2e32-08dcb82ae0e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|1800799024|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: uxpLa0DdYjOGnptlybFHH/hraRbdwgpDST3trQWyV8kzA7nYR5WVpH677jMTxBTInprIL4TtMQsxqreaR4xC8+FctMpmpo8+BPGuWccq7VgZFCy4RLEVY+vX7DQBVGw8Rmu2AdjssYSseUIab5D+QYExiIUKjQOCHpMsQox3O6W+JZ6AE0UAjEfxZjdsOkOS0Kp95aEXUGkRFHo1YS+8osb5eVIy+jp64cE/mOeu5CxwcWobqF31EcBoFq3BX/uIOkNc00fU4/KZHT5hTlP48XKoEm0czcZoGD8X3lIeWZWW/Tg5C0flqhUBNO8v9Jv9PGNjE3AVjKbEGytlVI1fphmgyvv1RKS4mIdAY84K8cKc307OeBE5y+4TPJwJLDemDWsbxaFnDrg1RCBh0qv87giz4HKvT1vrUCGUrwQwkACM4mgAU97Mh3xV/k+kYwcOLNOMeizx4HDG0urQn95KvoPiQesRF3v1NpPCjGFLOigJqU2wTKSgaJQ26oqwDoTfVV3DHvKh+zRIZj+AZLcTonRUfMVO6QroubQqDiuPbQhJtDmCeNJqT9hhag2+ygKPJThr2GwdsgNuCiD67nrDvWwlVJhGkPiYxvf7OTUeQUOGC23Z7GpFl6cMddlI44yWmobdUSyojMTTgn1LCX7ubvlr6ufwW3//FcsaNRvEE3FAwNOb3NM/EYAkpSixUR70jlYb7iIoMXaoJUH3UThgwy9XlcvU0s4u5yOnXzAyvokCizYb1f+d02tUoDXhEdvsCCruVJfMjOYTOAQ01B93006M0bxpAImgjrURzIEUZbs5I4loshq951kVIL/zsi6tMOEvtEhN+EZVex16lsxAP4dK/8jUKDzBvVQBjpaTR6dPifCXIsTFduttNbX/5QZD7JV9cHkO8NGhYbEpK8Wa7c8l9T+cB4s8HN71+McdswSg5Ne08zInFtzq9ZiVpyz14Say0SHAjAFAyxxTpY2KZFVdi8J+wAS2r3oNqIHkDJVgJTNbqQ59L/0AQy5IP3fOv4zm3uUBD2Y7d3F7p6SJwraCxQT2/IwIeQqNOPAXJXjKJbyeRtJC1JrJnSMzvjlVfI17QedrUjFM71PIKVdimsrqYKkXtuWXbsEWEy1QWdKEc0B5duXZU3sEckepTPYKdVyLRl+/pbDPRhrwG3ntb58hnBpVv/bHRpZQWtmFHrkQQ5gZ2rWgBu/D/XDp55x0I2daMJHRJsVepNpSzFkmdTVagrzzFmK6tJPU09IW0ZyD5kYKjfEbMmAyzjB7LD80Gl2COcMKSQNKgCQM71rbXIXIIxvLf/dr2sosNa8NNbthl/SZmZ8n6FuZq/Fj5QLf40j7Ibdt/KJ6GHezZ/vVfGR+cFTFCVniE/UE7IFvNY2zojkwAj5tP21p2u9gHytzCviHjAhFDr4/ihDrnALpXpngTD5nlILkwzbVnphr6pg= 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:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z5nL6jOSJo9tbLnkhLuD9oPfB/sXeEFR18q7g+NamYP2VMmh/BH0XC7va3SStM3NYYEmsN7lODisA4mHNI4VPfM/f1B0ixUv3h+BgaNS0ip4XW5c70WN74v4gfeQrSlMZgTvwBTqfBUFF7MOH5bC+JmmSkoDpFB0Qq59qszTw2EllG+872sxX7TojswEQfWdJcF9xTWix3fNFZXpNqW+dxj6UuL/RJj6HUEz0jN+1VuQH/oy5DodxAwySxdHBoz3f5DeIMWfPcLr4ahEw09RMaozkXTDlsqMFjyxsUPsr9XCB8x9EBvg5zMjE1gk0BmQ9t3KOe0t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8rnTt8gePtHn+kUgrwTytG3DtW9SujDk9lP2Vmu3qF3hwDwXxeQZ4NzWiamho5zDRFMSpDNPr69WcHElnEeGRPuEqoMCT6JUoEMBjBAjZV6LFW8S3blRWJBLAoENusJdtj3LmDOb9smY5lQRbouJeq99Z3Pj0f64M/6OXhYZsyeeOsIKqZC/lC8Hrbu8RvEjm2RWkY3RO9LqUb62H8LRRCEfSfedrJfj8oqDKm4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7cba215-7dd6-461b-2e32-08dcb82ae0e9 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:22:28.2171 (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: xbjS2+x0pO6KD/s+viEUWso2XAtgCFfIUHu97ORmGfpTmSc8IM1m71k7cV8mA7SuCLyn++IY0xWrOPy0se3go4JbRV1/ugTk7kmhF+xvqndc0Ajtqy1pTklQoZKlUvui X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212231_093191_DD2085D1 X-CRM114-Status: GOOD ( 21.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We already have of_graph_get_next_endpoint(), but it is not intuitive to use. (X) node { (Y) ports { port@0 { endpoint { remote-endpoint = ...; };}; (A1) port@1 { endpoint { remote-endpoint = ...; }; (A2) endpoint { remote-endpoint = ...; };}; (B) port@2 { endpoint { remote-endpoint = ...; };}; }; }; For example, if I want to handle port@1's 2 endpoints (= A1, A2), I want to use like below A1 = of_graph_get_next_endpoint(port1, NULL); A2 = of_graph_get_next_endpoint(port1, A1); But 1st one will be error, because of_graph_get_next_endpoint() requested "parent" means "node" (X) or "ports" (Y), not "port". Below are OK /* These will be node/ports/port@0/endpoint */ of_graph_get_next_endpoint(node, NULL); of_graph_get_next_endpoint(ports, NULL); In other words, we can't handle A1/A2 directly via of_graph_get_next_endpoint() so far. There is another non intuitive behavior on of_graph_get_next_endpoint(). In case of if I could get A1 pointer for some way, and if I want to handle port@1 things, I would like use it like below /* * "ep" is now A1, and handle port1 things here, * but we don't know how many endpoints port1 has. * * Because "ep" is non NULL, we can use port1 * as of_graph_get_next_endpoint(port1, xxx) */ do { /* do something for port1 specific things here */ } while (ep = of_graph_get_next_endpoint(port1, ep)) But it also not worked as I expected. I expect it will be A1 -> A2 -> NULL, but it will be A1 -> A2 -> B, because of_graph_get_next_endpoint() will fetch "endpoint" beyond the "port". It is not useful on generic driver like Generic Sound Card. It uses of_get_next_child() instead for now, but it is not intuitive. And it doesn't check node name (= "endpoint"). To handle endpoint more intuitive, create of_graph_get_next_port_endpoint() of_graph_get_next_port_endpoint(port1, NULL); // A1 of_graph_get_next_port_endpoint(port1, A1); // A2 of_graph_get_next_port_endpoint(port1, A2); // NULL Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 22 ++++++++++++++++++++++ include/linux/of_graph.h | 20 ++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index e4d5dfe70104..dace154baaab 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -695,6 +695,28 @@ struct device_node *of_graph_get_next_port(struct device_node *parent, } EXPORT_SYMBOL(of_graph_get_next_port); +/** + * of_graph_get_next_port_endpoint() - get next endpoint node in port. + * If it reached to end of the port, it will return NULL. + * @port: pointer to the target port 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_port_endpoint(const struct device_node *port, + struct device_node *prev) +{ + do { + prev = of_get_next_child(port, prev); + if (!prev) + break; + } while (!of_node_name_eq(prev, "endpoint")); + + return prev; +} +EXPORT_SYMBOL(of_graph_get_next_port_endpoint); + /** * of_graph_get_next_endpoint() - get next endpoint node * @parent: pointer to the parent device node diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index a6b91577700a..967ee14a1ff3 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -59,6 +59,17 @@ struct of_endpoint { for (child = of_graph_get_next_port(parent, NULL); child != NULL; \ child = of_graph_get_next_port(parent, child)) +/** + * for_each_of_graph_port_endpoint - iterate over every endpoint in a port node + * @parent: parent port node + * @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_of_graph_port_endpoint(parent, child) \ + for (child = of_graph_get_next_port_endpoint(parent, NULL); child != NULL; \ + child = of_graph_get_next_port_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, @@ -72,6 +83,8 @@ struct device_node *of_graph_get_next_ports(struct device_node *parent, struct device_node *ports); struct device_node *of_graph_get_next_port(struct device_node *parent, struct device_node *port); +struct device_node *of_graph_get_next_port_endpoint(const struct device_node *port, + struct device_node *prev); 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( @@ -132,6 +145,13 @@ static inline struct device_node *of_graph_get_next_port( return NULL; } +static inline struct device_node *of_graph_get_next_port_endpoint( + const struct device_node *parent, + struct device_node *previous) +{ + return NULL; +} + static inline struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg) { From patchwork Fri Aug 9 04:22:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6493C49EA1 for ; Fri, 9 Aug 2024 04:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1oY0qoi/gJg9xYf1gx9k0f5cIYZLqGIIdG5ovK6TzRE=; b=QZtNYTMn1db2ZNcm8TkzWeBjOp 6TR13zNTLY9hQ04dFQu3StBq9Wn4MaDpQMSgrDvn8X7E9yQjDEkF9COcREVftz6idGKRoqRAw99Vr DZZobnXsHMuNd4m/AZj/MbzjimpprdCcA2jHLU7l10Qac8hw1OzXi4szOMKRFiBgMwUxSmjn2cl2+ fa4AbhJkSh/g8LUWzl4sSbO5LOYNamfsY6Ezkv9cv0wUDhd8PlI4cJVUYSBwHCe5X0DRgdBriQWv0 wNxO8P46uVjuD15I0vivQ1XwPVD60MCH+OJmrWUsaSR2ZSIxNDiYV6KVMVDSfiHv1CV77WTS+i6QY 6T6eFEfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHB0-0000000ACzi-2A9P; Fri, 09 Aug 2024 04:24:30 +0000 Received: from mail-japaneastazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c405::1] helo=TY3P286CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9F-0000000ACXK-1WkG for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:22:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wral9Xmtcuk3Orj5PRbX7+w4bXeiVHY8heNSQ3JCDo+5KDy8NrUCc3Rh87ub4vDpOqC16bI4dFJcCIO1FfksJgdYC4eOUV/zL2fQDcbfu7VSKibAhjmH2p592UeZCFtCGjftjLerxqZPHHCIKpmGLufvvgfPt99PexmXXgzwcbXCslQGk1pZ3/qUKsHWb302GVf5xBtQ2lOpTFza8JeF8cBaOgHmFlyNr0YJ3Av0EkQrxo8StzY5zsNUrhmga83f//PvOBZnBaMH1Qquhe+1Qqe2OGpIhD0s9aO7NEQqrntrNutXERQte1JS4pctboaRa6iEzeLzISIHgZGmod04yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=1oY0qoi/gJg9xYf1gx9k0f5cIYZLqGIIdG5ovK6TzRE=; b=YmBvqp3TI6QqcilvQD0/r4LRKz2vvweUWOg9CJoGgTH/G/5mzYxlwPr2dD6pPM+Nzzr/MG+Qd2xkqs/WKcyuVeEUwWQTyXoltHu3cdriP4DJM6Nr0XurL4TDqgxdqkbMnLH54ub4FEk7vfX8LtdwaQfNMT5wfpWvOOOQLIwZAZEjKGdvJ5BUS7ZoLmPz6JRk8UzVJdHgO70XduLM2GTW/5HzUvbWCNKoC3QSvVWACJ6pcHrsCMRl4DMty0SVAzYra3r639svDNZackzfwM2Oqa/8rLxW+6cH8df/PkYVV2YI42J2XTNoCJuXI5wCYea/JpalMb7kTt1+loHa2arFNQ== 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=1oY0qoi/gJg9xYf1gx9k0f5cIYZLqGIIdG5ovK6TzRE=; b=iFvnxf2p7XPNOqJuYrWboiJ+N8S5JoBh3PFoDWy6/BlWg8TxTcjcrCEfTUvEhGl5D2/X097LStLyW4zGhNhAC518ynlgrMvfy1LiUcETwCxrNjYs4vyWiPhC8L7CObSLXttkYccq80izY4WGpFTEoPjxXU/WpuV8jyGmBtZfKck= 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 OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:22:39 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:22:39 +0000 Message-ID: <871q2y8gvl.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 3/9] ASoC: test-component: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:22:38 +0000 X-ClientProxiedBy: TYCP286CA0196.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:385::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: f90d7454-78aa-4a76-44a6-08dcb82ae750 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|1800799024|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: mO5yGr61ou1SSBAHHlFE69f/kkWoHE3G3a6bpRMWza2NoglBFTaf2Zf2vaYsRTFxslz8PZ6OylP6VUVyoQIQ+p8BEckTMrykS6nkiwszb5ZeprzAbIYI7MT03WfhzYtSJgHrHo0c6wLo4feCTWWyblmR3QPKH4StnC9lNkIndteDGSDqd00a63DkhUkWwFyscOluKzSvZaHZ2le4jHd1j9GNbRZlhCv2Sy7Qymi+5e0sWuBrMAN+lN0tB9H4LdwJMWcxUDd/TIcnwNs9epAlLjOduiNLbIxPhQa/HkL9sdNdZTXP6xdzneWty8j9DS5k5DWRwMlu08tVuWAYi5kj6lmREg/MlaGoLwze7d3tXUDPiVrvQTcRUwO0wwtwlI3e1/diVMCZ8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CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Xxfu1B5NhdHXtWM+N/4IjYn3hl3PCtD6phVZekVcctqsMII5YGHhJ5CAmDPQRhPvYq8Xn9AiXF+6ZmzfWUWexI2ZxvVOk/19OZz1kolF+4ikqdOqDLmWQFA6AZ7eppyzSL6GdmBHh7O/VWRgojwd7bhm677AAeg9205k3WmIx9QxvuO+VufoOE//V10o/y37xMx87qiIw9UpGRvd5nZE0cFALxDYf5/as6owG/dIwj8+Wp1LnzootW7m4KAfoQbcrW/mQKRwRQ+Y9bo/YxNMo23FtjtzsrwfSS/5TGRS9d8GuO8+IakN0XG5Sto7adgM2yB+WJeg9u8S/QcKbcaYM1mvpO4epJcu0yoSRs1cSGYeFHtX6ou8jWcDryQOE3+FRtxrmyXePh9rjF9nlYhkjxWZdkEFtPshZUAswvQyl5H9+5KwRnHnIe5UbY+KqmBq0nz8W6bgw3vtWD4RHVIE5uzwAUIq51xbKAn/ME1a0UC2c6bIpTXAyxqhPAhFxCsVtwbUP5yb/ySXF0Gq2QhLkfPRJdDUieoh1Y6vk9o+naPO2CSrBd7TYJpuKVfrNJBLelhCBA8Lun3awXIdEkbo2brsYvzOJRtcgecnAsA4DBQhQ2H3zuTew31X6hFPnlFwoUOWeMYNj4ucLaMXR/l2IevoRnLTBU9unlxp8ND0xzJM8sqkARa62M8jiNweHfWzl3nOE924nUqoCYzeH6sKfhx/KgGnWu1MuREBwa9pO1l1scGBA9ad6+pqKTu+SSMCeL0rSJLnefe4/54RlRwZN8BDTZ9T85Bq6t8fG+kI10D8Ge6eKsB8G5FIQQlmt5XM6lg7rqOMCjeiY7rEmUyfdBga8BLucrv3WFx+mgP21B5LJgC+m3Cbb4Qbk2UXUHytwqNhm20WhlSDS8F5/48GT+qGjcxENMYocb+DrL/I6tlaQBT9OS23bFd5LLYmbMnlOJc372BLrIaF1J8DsavtZ06n8RdEsgh8u+Q2bsuGuTZRNS91K7QXbJpZUqIXOVeW/YUsL6giwHaikoar8tiIohM2SfNeDuK69ycZRmkxT1DXKO09m657+OJ6Rz/qsOxW+txjvk2WX1ZG11csT0HaN+HOMmjg6kFnhKkGSRP9nLXw/W/s5wK05yEzM29eVOOoZqPClxKvxqAZHjJPn8REcC47F4S3Y2Aaerb9WuEdC1DotpaMxm3x+urIrb9SScDKaHRgYIh/nYCkzwglSFOTTI88IJkOuCMKQP7h56C2VSE0ibtvL6rhXg/z1G7Rz1QY/HjhXNkHUsCnmNYGFozI5v8fl+LuCELz3klFJpRZAHgTJwllFLUx+s3NAoS7/vij7BpwLb7TnSQJi2VmwqCA+ce+iJSr8GJKQUJLedH2ZBMmlkHcgN+/rnCOIHxrG+kZu2/iUR4zv6IoaAeCIaqLN0iGhmRl66o6rQfFR8p5Mb+Zs4ECCRt/fJAlPIV0GLnFchR0jlAZVjUxjWd1hFX5t23/t/9o0IRKfldHr9FpcxLHos/6iea1RUef6Ka8KxJPH6DUB+bInbMgivxXwzTKkwdTSGY1GDZPZbFTUhr6LZYDz/z9VSgnMPNvP2au3DQlwcPbStO4QF+ctKGU1GMS2Byrk0uxv16EHkmI96NPoag= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f90d7454-78aa-4a76-44a6-08dcb82ae750 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:22:38.9825 (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: G2+MPAOYqzzgffPaUX6yu4lGZLqga3LVfAG+hyYIF5Q+R/YmBKy1Qs3f+2qUrZ0f9xt0lk8fLq2dCYF420YbrJy2DM7SgqByJNaejPsPc/X5h4YCTWXriUBRMqLIsstH X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212241_543907_BB066C7F X-CRM114-Status: GOOD ( 14.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Current test-component.c is using for_each_endpoint_of_node() for parsing "port", because there was no "port" base loop before. It has been assuming 1 port has 1 endpoint here. But now we can use "port" base loop (= for_each_of_graph_port()). Let's replace for_each function from "endpoint" base to "port" base. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/generic/test-component.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c index e9e5e235a8a6..36008f3a31b1 100644 --- a/sound/soc/generic/test-component.c +++ b/sound/soc/generic/test-component.c @@ -530,7 +530,7 @@ static int test_driver_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; - struct device_node *ep; + struct device_node *port; const struct test_adata *adata = of_device_get_match_data(&pdev->dev); struct snd_soc_component_driver *cdriv; struct snd_soc_dai_driver *ddriv; @@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev) } i = 0; - for_each_endpoint_of_node(node, ep) { + for_each_of_graph_port(node, port) { snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i); ddriv[i].name = dname[i].name; From patchwork Fri Aug 9 04:22:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 147F4C49EA1 for ; Fri, 9 Aug 2024 04:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nnM/bVJH/7MwtVBHhQABMeeqNeBOZIi/dXjU+gs2Who=; b=CFRAhM4qkMwDpTZOxhvlVAR81s 14ecCDR2DlDnbEDZNuz8HKggyYLcJCUdg2jfpatNdIm/528pM23XggYCJHaV83lTyCKfxh+/4wBHU 3zQpR3AsSlVGw/JwuURavYWBk5gi6k5mr/tvlm+UgMKo1/APwJTZsjrRdwNI/wuvjHHjUpE2TJEsW GGqwxZymYLRxaqfjh8+fBQUshwfJ+QyhvTvI/RsgJeoBKhzevhnVrnVxIIHoIesdLU+Rjc1vh0RV1 5+GEfr6COfRbgOE0N7sigQ/XkxxVRSn2rb1S8zHcK93ACXlQMp5IGwZTKWwHrx5IFduArBW3463IW D2e9fFCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHBW-0000000AD57-3g2H; Fri, 09 Aug 2024 04:25:02 +0000 Received: from mail-japaneastazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c405::2] helo=TYVP286CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9P-0000000ACaR-3Dlm for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:22:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yFNTxjH8BvVeB5wOylXfoOvwrc0qw504jAN32+68x/HQ8IPgZg5TEKmNmC+NkdDopEdnPpNIHFeUXce6q/A7bYp8CyEoKsNT5n+OFxLmnlgNJMC+O7CiIl8HQ2/58Z7oom8bTsRcxHJOI67K6KeK14D/oiFMyedxPQvKK35ChX4AfJczQjCEmRIcJGtRFy5P2cOTTNFvkZF1ugPDkE6hjdtQITmrt2y24EcWtWpHiVwE5vebdtPDPqrbkqbh9kv8U7B8bywptHOcxAHmvd4mCxvsxqQDDukaYji4GqSryzAi0lVt9ImuC0iSi6P0I7a7dWUCPssMSXRAYouGCs6Beg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nnM/bVJH/7MwtVBHhQABMeeqNeBOZIi/dXjU+gs2Who=; b=qb5UCQxmJSPrhGO1MoFFcfaSGbmvfkulgg3CKRRrHyvk1lui7bdReQxqrYSRCaKCEwmIgn+O8XcIW34lRg8ADLSx4JLIq4g/FFaAVZ6SSu4vgEH/mJykrAPe7MRwqPgswUZ6/C64Ut5alxlmfGkkwnKtz09Ivw7PEMOFTbWKvHKMvexVgoD4d0EHNZlkh8k8TlhA3l7+Sl1U6Nr06HOkBcMtN8npdKGBgs060Is+9zWMdPFnV7agMagePZaI+YELwdxMgfx+7U5VTr1iZoiNIZ75wnZW645E445h9Hug1B4ZAX/2TUxeDOL0vmHlxxcBZuVFsFeexOojlUqmaGZ/gQ== 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=nnM/bVJH/7MwtVBHhQABMeeqNeBOZIi/dXjU+gs2Who=; b=EXIzGHr8pHvYZ9XPkdRHXTDbKpJnn4dpwjLEqcqG5zRT0fteSQ4HuZBIjxSDA9VZ1OmjpdXTb9RrlvwKy3QHTKHF3f+vP1FN04SIgI/SWCzq8mnrXEt0NRHwotCzNSIuXFAQNUkHOmpelEysQgwYRG08n6wyyC+n35rBgJiHWKI= 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 OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:22:44 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:22:44 +0000 Message-ID: <87zfpm72b0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 4/9] ASoC: rcar_snd: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:22:44 +0000 X-ClientProxiedBy: TYCP286CA0358.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: dea819a0-5db5-487e-cef5-08dcb82aea92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|1800799024|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: eewj0mtYeuLtDRUo7bnrr9dK5KW3YVnD8byggA6S2ogbfXs4Mu9/skOGI3IwWWp/umoWllPbRlysckZQOTm6k3Z7+BscZsW3pZOp7F9ztZLDLHaes0bAbb4WWhqRDm5IS/yAsAQa9fLz/7PmjSOZNBD8zIwTUjLJjwzbxc0dqopbXOYoyS9d2XLgVViaPr8e04Uh90qA1qT11zwRFnqBGND/GeBRA2tWOyjuudwpZMQKMwvQgD4wbS4hLzkjr1rUDCIiYT72wmAa2TgArdqvZxIeKhu0SCEHoIjS1YBsiw85eCPLJzNlq0HrTVoJjwIPDmESdN0veDAWfLGGYtKFx6QD2KK+DOOxvDwFe9hqunr1pc8vMWjJL5qji8xKt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L:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: C/LqmRyN727eznM5oRi0lLp1SEvynAm/xmp5H5Niw8K4vL2R5T61WwL0gpRY33BMam5X9Hvbw6/854D8D8/TtRXw0d6NKOEEUdsnxwfCTyoJgjL2Z9Ql+j/QNfnkyQ46EXL8tUYqU+cbqK5VdfXuow4iLxXqL5jSLU7yFXnMwms+bnTNNZrm8VjB95T5jLhjz1ENsnggbTGeTzSaCn5bEyua+Zn/P5eU0xNgz5hCvzuRVcF4BSlSQuEOJEmR1gxcRjwIh+RjvBr9NwVtJ5SHvML2dLRcEyAtj0FGB8Z/Dv3Ayig4BGZ2jOyX9IwSBXGsKC0hK88IKvtrmgNGSgEGFQVPnTpnDrXwWZBnogagEWxk091iHsNnsX6apFJm/Scz6p+FophMJogPV5BBrcUngKeeBVEbxegg07epE05oV0v3OkPbsbv+rvzf8MGjjj/aLvfheUWvAdQRdqSwj3Z0cR4DkMhtFnb3CQ3E/SPnSMmKIqGp/uPJ/3L1zJCMmLS9M9sOEfpf3yfNExvxM8Ret2D7qenjNIi3erX9Mcf047nCByrc7BOR3EpBsAOlUfahnj3J1gfGA++AjHspueWdujRKy19ZEXVwEkUBIgdA8/gPrNM7NBWkouBzD4QcniKDMIEEF4ogUleP0Qy4V3V5qcRzO8r9J+WCwRHbYvlVjSGTRwF8bkDPQyxw9tFo5xpGwD4edm+FJ0gH0/7OraU/FE3F5TyX+xuL0o/01x9ChjISCRO4p0dH9MhwO8n2UiY9ydsf+qGqmLNogus92ypSkg34lf31/zFtMVbfyZruSKsm8eeLm3lNFcLdyHwW9T7CillfGUem6+NeB5cyAVQRwejXLkpxOJ54agQ/WnsDlSLLz7aHZPziqRt1jiX066AznQom3zCAlqxbBO4s12QjzKm9jmRPqBsuc8qnA1WF+0Hh9WmdMp7jRqkwOHa5rwDN/NMzYUUYR/jjDLzZSzJunECErQMl0S+B8O8AF39q48MIxe94pMfNEO0039QpVtac1msObhVUhhQsAPkdhak8M5VLn8wGFRYLVG6MjkDEW5DFXBwSDNn/7IJOpW3CWtdZmip659yGXfNOR40O/WadJ22pO7yHE7/1n2gcyW61ALCjwvK4OBR83nzrxjqyX8m7aCTIGmd9kWb0MzeQaz0drFy4n/WW+7IvXplJDzDjGleUCyhnjFCvYOkJsQ5kptLiFjFtm/zfPtaeqNKyUZzubmjTtTIdcf+MEjwWpwIE517gaZVuqwQSE4l8DtfznI9D8nTG32vHaKDKRxo2eFrNbWRdMffMVoatgINNaTSwPFbXm9IOSJuLZxy6Wb26aS+lBI/yoKO8YivHe30pY3ap6e9kbnQ8J+9UJZp3jaUaCg0YyrskXs83w8fGuJRvo9twWyE6mWwlgrlaFDIMmbxtfpiobcvEGy6GhtwwGOPeUv5kTGRkY8YWeOADG/dyiga4QbK+KeGyegsHGvFhEfWD2qT3d69+64OiA1bICYYnRPO/vy6XZcENttI1ZBID0MEgxmq/UOi9AXzgA6bm9UoWOtS0kcf92RX2FHZiZ/rmn6V5XIFGda99LxmKiD8qqdxH3CLUhfE3VbX7lJfNHY4yb1K4tw2g7jSs2lChvVTDcS0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: dea819a0-5db5-487e-cef5-08dcb82aea92 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:22:44.4304 (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: nWJFQs5Nh9J6iUbroDZAGjfBkNgtaXdJKGpcEKyWGmDDG8RgFPVl7V1M/3S9wvNOW+a498op2jDT+9JL3eIfQ9TKPyewNgmhfFpoFxhyRGBVsAhIYfMCBat/ZUZ27LYQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212251_885713_4D14004E X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/sh/rcar/core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 63b3c8bf0fde..eb146cf836eb 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -1294,11 +1294,8 @@ static int rsnd_dai_of_node(struct rsnd_priv *priv, int *is_graph) /* * Audio-Graph-Card */ - for_each_child_of_node(np, ports) { - if (!of_node_name_eq(ports, "ports") && - !of_node_name_eq(ports, "port")) - continue; - priv->component_dais[i] = of_graph_get_endpoint_count(ports); + for_each_of_graph_ports(np, ports) { + priv->component_dais[i] = of_graph_get_port_count(ports); nr += priv->component_dais[i]; i++; if (i >= RSND_MAX_COMPONENT) { @@ -1506,10 +1503,7 @@ static int rsnd_dai_probe(struct rsnd_priv *priv) struct device_node *ports; struct device_node *dai_np; - for_each_child_of_node(np, ports) { - if (!of_node_name_eq(ports, "ports") && - !of_node_name_eq(ports, "port")) - continue; + for_each_of_graph_ports(np, ports) { for_each_endpoint_of_node(ports, dai_np) { __rsnd_dai_probe(priv, dai_np, dai_np, 0, dai_i); if (!rsnd_is_gen1(priv) && !rsnd_is_gen2(priv)) { From patchwork Fri Aug 9 04:23:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AC6F9C49EA1 for ; Fri, 9 Aug 2024 04:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qK5GeS4438G+wuSpWRz4kw3OeJYBGQhsiwzGxzWZ9zY=; b=g5PEU6Gv/ZmjOxzRKwP8xUhKAF AHkL7EPAFT22lnUOXEXIRMOqdV/HhkbXTPKAmK2ONEwX3TQCkQyUGvAzj9oWk/GNUbuU0LX4/OqZw pk5I5uX0/TzsoDVE6Vg8lnCd4VfWnWqWgWdpjcwfYGjinSL30zx89Uw/MngGUvRlm1EfTdx+d4bBK 9VrdjY2Zq6gynuJLGAMdTNmHSJrncKcyq4W4upSIUhrauKuCKDQ7eVFZN2xRessF16Epqk5Qev7LH BJN/qp5NNbd7srG7Cjo3SwSjDyPH+FYcFd0XcxPIjeDlof0mcEIux3+ZUplvHiqLhCfSapDRFMhvG oOKtK0sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHC4-0000000ADAN-3MOs; Fri, 09 Aug 2024 04:25:36 +0000 Received: from mail-japaneastazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c405::2] helo=TYVP286CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9g-0000000ACeT-2Q1L for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:23:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nsFS5K7b7gk6IqIVNedaAxXByrp4FrSwfV+iYbXXIYzLiMgjs3jk56UJqAqxExbJbL3aSUwnWLTU85HGliap4QikEQQs1qpmiQqGhIhxvGNDf2lN2GH0zrrXNPlE1EmMDARt5iwd5NkMDeiUz4XTtydDA0K+5Sieey6kVoas4adNenuGca3P0Qh37cclG2FlCA7Qbk0VXUZksoNR5fEKRfESqOjr4s7cBSFaj1SiH9X8Woo5DmRSvUI/HStc2N/M57rocBvsfQEq39nFrHzmxx84HubCKJHomjyt6D45yR6wXJxfT901q5/qxujJ9kyB+E0bfnQdq3aDADDa2ASbzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qK5GeS4438G+wuSpWRz4kw3OeJYBGQhsiwzGxzWZ9zY=; b=W6Asy736AAvPAUkwbjrU+6GVFnde3IdSnD2WXWwQxIrzTJfLTLytw1Jm2xyae3R6wh5/gbkJk6cWN5gxyKngk1+4gugai9JsXwsdzz5byYv1y8iT6RS5M2jwlmsAejpmJon7l8QhBnJJP9UpxZ9m+6nQTTvAo0EVRnIggA5Pg5agQ1ym/jIBaytxpmQYLKG4mAwXA/5k0xTcKjPuwjLy8g+aYQ0DbjEK3/0wytldDaNgdY3nNWbYukLx+7DrB3VxmOjZtzZ3HMgw8N7a6JahpnJLT8T4uXejl/A3KcWStH12Vl4Iw79We8LX3S9333oWt/69UdyGGucX7VAjvg9+yw== 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=qK5GeS4438G+wuSpWRz4kw3OeJYBGQhsiwzGxzWZ9zY=; b=mdJ0zwYgla9Lkvc/R+NRYhL/MZzUBDC1apMVWKw2/Oh0saVWTHKlBYwhObX5lWP7t82BzpuhxB1leInANnY39DaU6tNsolh7WRDXXERJvGMDEpmUHXC9BSbKY2b0PNZRRGbbyY8dVJcwzciWnoBDy/E0YJatvmd1qtV4ca+dGJM= 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 TYCPR01MB6400.jpnprd01.prod.outlook.com (2603:1096:400:98::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:23:02 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:23:02 +0000 Message-ID: <87y15672ah.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 5/9] ASoC: audio-graph-card: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:23:02 +0000 X-ClientProxiedBy: TY2PR04CA0013.apcprd04.prod.outlook.com (2603:1096:404:f6::25) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6400:EE_ X-MS-Office365-Filtering-Correlation-Id: 4fac36d2-4c49-4c50-82c1-08dcb82af578 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: KoZKWCcxh1FZvynaTJGS9O750Mmy+Ok1U4D4LGZ41bZvlad/zEzSEZY1/LcrQytgGegU+nBBGRIpOkKzoaYMVDCpsb+MyrDALf9GXKpzPT96SpbsEYvOWsdA+S0G8qnRZv2LWUoQ9n7+37CUvldP8735fkvYShsLQ9hF8wXlK/IcR2U3/W1gD1enzFwCqmqlQyy126En7vKup3uLt5j5c7og3/gfcNtdTBGQVBvKKHX6oKiDjWkRl62n9S4C6XP+ZjBEYASO3zO/nogG/oWTAlW9VjnH9gIfOV7GojWqHMr4bjusBg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LxZ64+8RxxGelmjKOfvCdTK8OoQ++9y+XyNzKU8td1mxjZPWKLR6e0YaVKpdj+m2C7UZvF8= 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:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: l4jhGplhiB6Y0limBwtQHlCL5BDaGfze5uAMB06JIBoPVQIZguRzOptF+lUgBPZm0JexXApuiy8PaOzHp7VT1XJ08xlUmKS8E0T0r2DqksddUDVltSZOXFdekYZItdSCD9/letrPulK8OY3bGMYEUbQRT+2ywJvg36BBd5bUu3HUg7fSizy/d17dQUKJ1DYxi9IuQnGyTE1VdJL+uM/+/x/oHinwyGJFSYbEJ1y/XhGnjCfEPzeDUnFOE4jn2rHltcb8vhc1K9SRi+CyQneBzW8QJ6Pm4SGjkcmwfpIMhfYJWMsGXdkfFAsFN1ts3e2Er6E6ULEKIOfSH+fnI+11h/hiL5OxfJGhKYZfwME7qQgVAPCzgDRnk9ryn3AnqVQ4xEhfPnPoFI77yPZnMXGnkpEkAq0IWFXWDgkTG7035owW4S4kQs0gZ+mhAC7rc61vrIJiO+mf6N49/7VUILheQShSJjSitaZ2lel09YC3gbTyimgP+5EuVa4XkIczrOmkK70j4T/ahh7Kt0qJJd/chu5BdVQEjFv7dyV6sf+ygbb87g25NUFdZNkJJFEB50siVP1Q+8VMGg+YWgl5XqPVShTT3PK7mNctBNFqN7wcIFgFt2121bzlImTrH3vHeCyEwJyEoAzY9Tipy9qb42JlevBn1a3mHcN+i5aRF57Zuxf+GDvewPXhucmanZmFcjwJ67Ik31ANxK595OzrTFwaPHLlFMDRoCp84yMidVUbVr8UFHKVmDrxA09mhx8To3TBA96FTARAfnoS1RDi+qmmCDlpy3hJAzlZc7ZCvyCnTVptapseWqXeuO9w/DMVu0Bs227B1NthLe6c+Z5NQZbLKpp4Aq4WUkx7wUQuQz60u5UMYVBZm4mXCN8pdO6ImO1doiFEtl7p2A7dB1/K2jG9YiBlg/mLCC+Q76aqJpQm/Ij9S/nLNP3DCSQyApxwvQ0CP7uZNHq3xu1MsMNUPhUn9dDd/6+yS7qjj6SKEvJRFiFfM0GVpIGvkzCPJJH9FvbSkt/CR9V/ZFXAa+O/0CAO4ii/PzQrQG6TW6IFGSOABz10ubBl72CusIW9K+lmPBGXp0XUn1+KT1wXfHCp5hcqn6x93c+ToZAB7MzXXiDmDnxPzvX0+qAD2YJ2o/GOYk1+nUYkj+Kqe3PWOeaD2JE2YNvcP1IFKy7ykpv3aSgBUbJiEKYqsmoJdgU7MaVXD41XaK6dbeWQpw8PhOk6C3zTacSKZs+wjQQjhjkpViKtEzz6lHeFNI7YGE8PeRRvnK/st6Rr++7ByN15uTlQRKcV/WD5su/Xq3NbsYg5wnSJojcposnSAeo4jqrapz06Qmo3HNWhRAI25+/AJrGUWAWwLMnz8DYkV1FvcxwSQyRV8u85/TEne781nCUrL7+hPlEtRoDWCmUPwI2Qv9qfjQNrS8NbyZ5i3VAk/5CCu/4CgLYdJ5cnt1JEv9lpNy0lGM+gunLlEDiB6Ai6BN6fh2z1BOW3dOBSyDRtqw8nV8AntVZ+7qUrrqy1h6gNt3brmpAkR9AW3wVzU0bkI6L4lv/T+xmkSHNNLUbEmSJ2q2J4CG6jZTYy8xsbRG10ISnmxGHgyC3tFPds0fCCU+RFr72YArJ+SrRPL2xmI0q/V9R2dK0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fac36d2-4c49-4c50-82c1-08dcb82af578 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:23:02.6943 (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: folpO/1Du11IA5cbclsJvRQ0vpNAhua4VnmKsJcoOj28zOecC7E+0X5XABIuW0njSkf0UVRJOe67pugc4UoIGXuIYzhL3a9RLVoBq7W0ATmjujtoNiwVKfWPicq7+0v8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6400 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212308_629872_E3EE95C6 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/generic/audio-graph-card.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 3425fbbcbd7e..040c271e13c6 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -376,10 +376,7 @@ static int __graph_for_each_link(struct simple_util_priv *priv, cpu_ep = NULL; /* loop for all CPU endpoint */ - while (1) { - cpu_ep = of_get_next_child(cpu_port, cpu_ep); - if (!cpu_ep) - break; + for_each_of_graph_port_endpoint(cpu_port, cpu_ep) { /* get codec */ codec_ep = of_graph_get_remote_endpoint(cpu_ep); From patchwork Fri Aug 9 04:23:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04FBCC49EA1 for ; Fri, 9 Aug 2024 04:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VN/zDdElcg66hXRY23ZSlUflCqrXtLJl6SysRvMczBA=; b=lr0SUbJTlDAcVf8kfGE5HMnzOi 9vGq21Kdrne8dgYLZq4gxKQgO1whAYYcBgddODAtRhV0UHTp899UBd4p+3L6TMJ+TfuXwN7S9Wlqw 4huLA4y2iMSmfiAL3i3CT4ZlX6rFjALdW033NUnrp3XmRwTLAztdRieAWtuxKFTiQzD2NNIinhLlF kLebGA5/T2+2lXkpzeXjxemE99a2lmI0worAfVZaexbhuHqo8KS2vWlmTIonMJ3xktHKpBdV5Jwoq LCIZX1IHCg1Qi+dz0Fmtub4kEtFnJeN1m3AjXOeLbk4eE3DxRQDD5kTeZHdovSfqw316MLyXH1dzL wp8GTaAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHCa-0000000ADGI-14px; Fri, 09 Aug 2024 04:26:08 +0000 Received: from mail-japaneastazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c405::2] helo=TYVP286CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9i-0000000ACeT-0gvy for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:23:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vNUqjQ9ALjiRpeEmGCrm7djqHfqgkdrMOFB1V/AZk6y/0uE7s9SHw0n7OS7JgfnpfKldMxLzj8A/Lw/uq0IxTpu0/4v6o7ueB+/M7/3afmo2Z+0Qk/vSFPOhLzmQUb0A/6GaCLzhPpy/EVZR50ImKqyQkc4reDviMLExuweLIavTk1auRwdsgE8RQasTEv8jxWXVxrLdEl36ExrHETWmlLgJbDdvh/CPqSnTv8hmVvmweOYgo0EaZcY3DHkpdDk8BhC+Mgvtxk5nQLF6mQHxlIND3siMz0ZyORUVZG3GaERO/aeUFS5jAPiTK4ZXa3TjyrIydXtiQzgN2l1Q0JED5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VN/zDdElcg66hXRY23ZSlUflCqrXtLJl6SysRvMczBA=; b=Ojb+v5bAgxTLguVf2MzPskjCoD/f3R/FR8Cxr7Be6gNCIdulMkaK/KNIYYxLdQwwbmndWGkVxz7zfdZpIcusX8ZLz58AXFa8z0JIYRNP0+azr0NMVTfJoNTCmL8d1kxWnBX9Ag2+DMjsfmCYJndaUhWcXwRM22SiNFuR99pzvHbRKBCxmKy/rotyn8MYzizpxbT4o4XQ3+R1mWLGE/3T1iFqMblcMzqR7U13lHnAMyY3EV96jIL/dPriiCs8B2POr91F2Q9hwL4qUFCEnhcVANmnaVqcuvDLIKmp+XDd2BGSITWn3BLz5PxIcGLn/2IwergajT/MzzejpdmvDVX0pQ== 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=VN/zDdElcg66hXRY23ZSlUflCqrXtLJl6SysRvMczBA=; b=aM/i3Fe2X1Uqmm+gl+z6Dt74FGERh5LX0qA2TjP5RXdcWww3Qqcc5HZxoRUdU6cC111hZGcEdTcjbzEa9kvvFHXg2rhGEvlEteIirjJ8jKzQ4asXJIE2qwWr3pEzmba1grJQKbkOQIaauL3qdKKnR3KBce0uav0tkkGt3aUJWrw= 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 TYCPR01MB6400.jpnprd01.prod.outlook.com (2603:1096:400:98::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:23:08 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:23:08 +0000 Message-ID: <87wmkq72ac.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 6/9] ASoC: audio-graph-card2: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:23:08 +0000 X-ClientProxiedBy: TYCP286CA0188.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:382::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6400:EE_ X-MS-Office365-Filtering-Correlation-Id: 1816faee-edc7-459c-276b-08dcb82af8d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: 2CjRCk2tM5k2aBUNP6TElcHAHAhX4kCjPWfRcvnodtkh5ypoodp2cVUtWTTuxOHDw6Ei/RzXmMdM1/GFFveV5CV6kOqn92vF6yd/2i4M19v6eyBvqFkTfCDc8+5iH8AgkzSQ61z9lqGzBeQfN3PxpaGJiHqGBZUoKYiXVMSyZ7BOvW0bPdhlDUzp1F/+hxHPR3vWJ99DYsTVL1w4pddv6KKLpHwiN3+LAlriDxSubBQxZmEjHB6LKH8SgfVJrYQeg8dpU1sfzXmG1fbx6RGN0gCTzsQ1W2qT4kzgD1/0LNWassdMDMsnkKjM/7GjAeb4b3Tq/EQg0yd612mzXxd6QwQGMN+P3gEAr2kdNG/seH2G3WDqXbdNxNYzqvUjma+wsPFoZk25GZhP2tT6iXB+HLmPY6GzVPxDEoiVCZGBglW26fEXMGHuR+rTngdN4r44ia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914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2eLg1VjNyJVj3oWFLgT4TfVKgsvXXjTOmUPvfGfc6ocZev2TafX8A4Zd2eTo/51+sUGn6wrAcGL0ucL/I/EHrMTA/tyAxsSP1bRbwCAtneWaqD/bInQobDholXc0GhCprN/BpVhNT1U74MQ7G28gzEtpsX106kdGd+hDYt1jQ2QxMJdMCot0Ulk0aEYaNYMKkyVhDLhRDnRpu7mONZDVJVrDo3TSiREv+QxRQxD2k94JutqUpw4AAOQENa/Tv0NOb8/w2ESBmkJj32KMVakbSOgykvLt/zTjNMwznifwaFQI7HDulLiXK+SLdEnlNaXHoykQiEUDbpIblFz0DP7/VxeiYOxKL5YXROLJj8U9B2EvIvW3mk/9NxKg5ddk9Kbe/1h2nDZWxE3Prab7TMy3juG+6k6CD72YDgqXaEo+WGDAdkpvVdeVCCgz3kL7Ey86135R5mHWWTl37UczsqdXxuUZFfaOUYqKNsu2VQhyO70TX0/NGiqSzluJytcToDMoKfUMKYEY9ki7Cq+ByzLWhlSY5gDIxhoRUDGSrlgy3ocjX9uuxHBPwLe7uUSfs8yA24l+AmGI1lovkl26eSZyhf8BYiRFwg/mXBcBw74h7ebU67dYRYIOZdByXoqoHt/sot2L0Wt8d2Cs4XJRpHvrbkmI5mDyD2Yvuphm8oGxVKpleEDiV7wYltFcrjj+9wFtXWWSZmZSOb7U0j/AtptYlgUWwIS4mqPZeteYbcE9yeSSLIgc+KOf3myAoAujOkKpMX4SZeEtQf3z4Fz4PRRE5kw2SctrW4BjGdz9woYTBscrKqHflMSqGG8TI6+ZlNTjaLZnMYvbaYpdCEuGyGNGzQKgHANW6r9AgYq6fQiGQhk8/O054NPPiLzOwGKVhLqWLSrDDwPwU2HXGUhg6kJ6NZOUfbcK1xucovPm1qxXzz9zEv9UKHR9suj8NrROtMRBPiG9h/pprJ8ZulYSL6SPUmQnvw+kkNyqjRmGdFaEsMqT5wLMR6jRvAWI94Weh5HHPSEGgK4DADHYrUW2YkccCSSx+GB9t0LjfB5gu2Rg6AKw1NAQNnSo5/A372M/KA1KPf0R5lwcngbAfz4L4SAhIMTe5eUAQ2nluNa9gAEhlXd4mOAx79WHzHAnyurJWbV5m7iudrQpxkKDcOz5bY6JqqLSI4B35gZZo0o3wRHHmTXfo0L3jqZP0g8zZZXjUw8v9MubQdjiQGkloupMyZcF8szRIEDvkVHUsHJu4jmX/PTuWCOY6ga1iO0qPRVuEDiw70bBcnXdme2j5ao/oG3T8TF3ESXJ2n0b71uxF9M42JIadwXNw06PdztrGYvctdiKxXZpPFmb7j7iW/GvsH/SwvabqtpV7JXY8KG8imfLcPn061K6x9CVWP33zqi6a6n+itqNj52ScNRUuXWEbqFurZ7jrqE/CokXEyAj+teH/OBDEc6Mjz+3eTJmrgmcGRskY1pZFfI60GybHSh1GfM9dME29M5h5M2Jhe/Fnk7TPjFojXCQZzwnC3Z5dEUu3AzuCsKN4ZrFaYlyeXwJdKQIaI0UCXpoy8fXqivwdv3bkOe8VTf8z1jxerXpY9ZjShnb2pH0skBFS/9HAyCEK9cxWFYHFBS1Jukq3eCB+cRmVrU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1816faee-edc7-459c-276b-08dcb82af8d4 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:23:08.3334 (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: ahY8rT2Kwp9f4aVinm3WE+TXTmWX+l+llBBocY08G3AXA1fHn4EUUvdgNPO1bMibPGhuwc3wq6zLrQxUaF5FIuqEIj9YZk+ICX4HTYasaM1A7w4mlwMkQLG3O0HIJG14 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6400 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212310_238082_65F8D553 X-CRM114-Status: GOOD ( 18.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Acked-by: Mark Brown --- sound/soc/generic/audio-graph-card2.c | 111 ++++++++++++-------------- 1 file changed, 49 insertions(+), 62 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 56f7f946882e..e8ea201dbca3 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -234,8 +234,6 @@ enum graph_type { #define GRAPH_NODENAME_DPCM "dpcm" #define GRAPH_NODENAME_C2C "codec2codec" -#define port_to_endpoint(port) of_get_child_by_name(port, "endpoint") - #define ep_to_port(ep) of_get_parent(ep) static struct device_node *port_to_ports(struct device_node *port) { @@ -351,14 +349,9 @@ static struct device_node *graph_get_next_multi_ep(struct device_node **port) * port@1 { rep1 }; * }; */ - do { - *port = of_get_next_child(ports, *port); - if (!*port) - break; - } while (!of_node_name_eq(*port, "port")); - + *port = of_graph_get_next_port(ports, *port); if (*port) { - ep = port_to_endpoint(*port); + ep = of_graph_get_next_port_endpoint(*port, NULL); rep = of_graph_get_remote_endpoint(ep); } @@ -530,67 +523,70 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link, * }; * }; */ - struct device_node *mcpu_ep = port_to_endpoint(mcpu_port); - struct device_node *mcpu_ep_n = mcpu_ep; - struct device_node *mcpu_port_top = of_get_next_child(port_to_ports(mcpu_port), NULL); - struct device_node *mcpu_ep_top = port_to_endpoint(mcpu_port_top); + struct device_node *mcpu_ep_n; + struct device_node *mcpu_ep = of_graph_get_next_port_endpoint(mcpu_port, NULL); + struct device_node *mcpu_ports = port_to_ports(mcpu_port); + struct device_node *mcpu_port_top = of_graph_get_next_port(mcpu_ports, NULL); + struct device_node *mcpu_ep_top = of_graph_get_next_port_endpoint(mcpu_port_top, NULL); struct device_node *mcodec_ep_top = of_graph_get_remote_endpoint(mcpu_ep_top); struct device_node *mcodec_port_top = ep_to_port(mcodec_ep_top); struct device_node *mcodec_ports = port_to_ports(mcodec_port_top); int nm_max = max(dai_link->num_cpus, dai_link->num_codecs); - int ret = -EINVAL; + int ret = 0; - if (cpu_idx > dai_link->num_cpus) + if (cpu_idx > dai_link->num_cpus) { + ret = -EINVAL; goto mcpu_err; + } - while (1) { + for_each_of_graph_port_endpoint(mcpu_port, mcpu_ep_n) { struct device_node *mcodec_ep_n; struct device_node *mcodec_port_i; struct device_node *mcodec_port; int codec_idx; - if (*nm_idx > nm_max) - break; + /* ignore 1st ep which is for element */ + if (mcpu_ep_n == mcpu_ep) + continue; - mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n); - if (!mcpu_ep_n) { - ret = 0; + if (*nm_idx > nm_max) break; - } mcodec_ep_n = of_graph_get_remote_endpoint(mcpu_ep_n); mcodec_port = ep_to_port(mcodec_ep_n); - if (mcodec_ports != port_to_ports(mcodec_port)) + if (mcodec_ports != port_to_ports(mcodec_port)) { + ret = -EINVAL; goto mcpu_err; + } codec_idx = 0; - mcodec_port_i = of_get_next_child(mcodec_ports, NULL); - while (1) { - if (codec_idx > dai_link->num_codecs) - goto mcodec_err; - - mcodec_port_i = of_get_next_child(mcodec_ports, mcodec_port_i); + ret = -EINVAL; + for_each_of_graph_port(mcodec_ports, mcodec_port_i) { - if (!mcodec_port_i) - goto mcodec_err; + /* ignore 1st port which is for pair connection */ + if (mcodec_port_top == mcodec_port_i) + continue; - if (mcodec_port_i == mcodec_port) + if (codec_idx > dai_link->num_codecs) break; + if (mcodec_port_i == mcodec_port) { + dai_link->ch_maps[*nm_idx].cpu = cpu_idx; + dai_link->ch_maps[*nm_idx].codec = codec_idx; + + (*nm_idx)++; + ret = 0; + break; + } codec_idx++; } - - dai_link->ch_maps[*nm_idx].cpu = cpu_idx; - dai_link->ch_maps[*nm_idx].codec = codec_idx; - - (*nm_idx)++; - of_node_put(mcodec_port_i); -mcodec_err: of_node_put(mcodec_port); of_node_put(mcpu_ep_n); of_node_put(mcodec_ep_n); + if (ret < 0) + break; } mcpu_err: of_node_put(mcpu_ep); @@ -674,7 +670,7 @@ static int graph_parse_node_single(struct simple_util_priv *priv, struct device_node *port, struct link_info *li, int is_cpu) { - struct device_node *ep = port_to_endpoint(port); + struct device_node *ep = of_graph_get_next_port_endpoint(port, NULL); int ret = __graph_parse_node(priv, gtype, ep, li, is_cpu, 0); of_node_put(ep); @@ -769,7 +765,7 @@ static void graph_link_init(struct simple_util_priv *priv, of_node_put(port_cpu); port_cpu = ep_to_port(ep_cpu); } else { - ep_cpu = port_to_endpoint(port_cpu); + ep_cpu = of_graph_get_next_port_endpoint(port_cpu, NULL); } ports_cpu = port_to_ports(port_cpu); @@ -779,7 +775,7 @@ static void graph_link_init(struct simple_util_priv *priv, of_node_put(port_cpu); port_codec = ep_to_port(ep_codec); } else { - ep_codec = port_to_endpoint(port_codec); + ep_codec = of_graph_get_next_port_endpoint(port_codec, NULL); } ports_codec = port_to_ports(port_codec); @@ -850,7 +846,7 @@ int audio_graph2_link_normal(struct simple_util_priv *priv, struct link_info *li) { struct device_node *cpu_port = lnk; - struct device_node *cpu_ep = port_to_endpoint(cpu_port); + struct device_node *cpu_ep = of_graph_get_next_port_endpoint(cpu_port, NULL); struct device_node *codec_port = of_graph_get_remote_port(cpu_ep); int ret; @@ -883,7 +879,7 @@ int audio_graph2_link_dpcm(struct simple_util_priv *priv, struct device_node *lnk, struct link_info *li) { - struct device_node *ep = port_to_endpoint(lnk); + struct device_node *ep = of_graph_get_next_port_endpoint(lnk, NULL); struct device_node *rep = of_graph_get_remote_endpoint(ep); struct device_node *cpu_port = NULL; struct device_node *codec_port = NULL; @@ -1009,7 +1005,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, of_node_get(lnk); port0 = lnk; ports = port_to_ports(port0); - port1 = of_get_next_child(ports, lnk); + port1 = of_graph_get_next_port(ports, port0); /* * Card2 can use original Codec2Codec settings if DT has. @@ -1039,8 +1035,8 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, dai_link->num_c2c_params = 1; } - ep0 = port_to_endpoint(port0); - ep1 = port_to_endpoint(port1); + ep0 = of_graph_get_next_port_endpoint(port0, NULL); + ep1 = of_graph_get_next_port_endpoint(port1, NULL); codec0_port = of_graph_get_remote_port(ep0); codec1_port = of_graph_get_remote_port(ep1); @@ -1141,21 +1137,12 @@ static int graph_counter(struct device_node *lnk) */ if (graph_lnk_is_multi(lnk)) { struct device_node *ports = port_to_ports(lnk); - struct device_node *port = NULL; - int cnt = 0; /* * CPU/Codec = N:M case has many endpoints. * We can't use of_graph_get_endpoint_count() here */ - while(1) { - port = of_get_next_child(ports, port); - if (!port) - break; - cnt++; - } - - return cnt - 1; + return of_graph_get_port_count(ports) - 1; } /* * Single CPU / Codec @@ -1169,7 +1156,7 @@ static int graph_count_normal(struct simple_util_priv *priv, struct link_info *li) { struct device_node *cpu_port = lnk; - struct device_node *cpu_ep = port_to_endpoint(cpu_port); + struct device_node *cpu_ep = of_graph_get_next_port_endpoint(cpu_port, NULL); struct device_node *codec_port = of_graph_get_remote_port(cpu_ep); /* @@ -1197,7 +1184,7 @@ static int graph_count_dpcm(struct simple_util_priv *priv, struct device_node *lnk, struct link_info *li) { - struct device_node *ep = port_to_endpoint(lnk); + struct device_node *ep = of_graph_get_next_port_endpoint(lnk, NULL); struct device_node *rport = of_graph_get_remote_port(ep); /* @@ -1239,9 +1226,9 @@ static int graph_count_c2c(struct simple_util_priv *priv, { struct device_node *ports = port_to_ports(lnk); struct device_node *port0 = lnk; - struct device_node *port1 = of_get_next_child(ports, of_node_get(lnk)); - struct device_node *ep0 = port_to_endpoint(port0); - struct device_node *ep1 = port_to_endpoint(port1); + struct device_node *port1 = of_graph_get_next_port(ports, of_node_get(port0)); + struct device_node *ep0 = of_graph_get_next_port_endpoint(port0, NULL); + struct device_node *ep1 = of_graph_get_next_port_endpoint(port1, NULL); struct device_node *codec0 = of_graph_get_remote_port(ep0); struct device_node *codec1 = of_graph_get_remote_port(ep1); From patchwork Fri Aug 9 04:23:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5224C3DA4A for ; Fri, 9 Aug 2024 04:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OJTI3fVU7PXFX1tjVUU8Ye9r4QnjQGrtjmmqI2Oz+XU=; b=M/+dpmgfQj5rv1Y8nsD2KINMZs SkFuH7vzBpv81kBqLzoa5oR04wUiZH0iBxNVukAcQfm+x+fmwFC9mAsgTD62LL5SiafFTA6x3JjOO xv3I7n9KbYUM9QiRspeyJPeERif6fFDo53QkL/N2/pR7AamNetm3+6gdleONECXwXbBOsIk5Z/4sf 8jMvoUUYXsJQlB2KZmueAP+IfE5Y66YkRaRW1iBJ4EcvT2vtLOWdznhTuoEfF22LbKSnXc4sfrcx3 jnTK6s6KuAP2eNjfmDYV8/DoH4mj5triXokv9U4vui6g/EFlKae6wUy5ZHSadTZ/zkNeBcRcmPB0f F3o+jK5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHD6-0000000ADLk-2hMP; Fri, 09 Aug 2024 04:26:40 +0000 Received: from mail-japaneastazlp170110002.outbound.protection.outlook.com ([2a01:111:f403:c405::2] helo=TYVP286CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scH9z-0000000ACkm-3uNC for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:23:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ErToRkis1yq0Ulk1F50yFrTMQAKUtESmZmLyXV/0YzEIAyQfhkqnTCnKP8II8a8wTT6fL59XqJjJITmTpY+KG1jDDmLcvaFqWP2lGoJwAYR3mdEJ6kk2zKth2/j+hq72kcxa5iKD+b/52VW57PdQxzfAzPtreTKYsK3C6yFgS4HfGOHT/IKnZJNk1afCkmOzSDMNOseZiutLifAEQ3hihnQFSMW4Mkm2DjdvYEgM8PO/HnbBaK/iQd9nxg5Zuga+94gCaKTlB1+fb1RnPFyfYQ3BTpZpsBodqfm0/4eB9ji9EQVYfa0Puc9kCGlShD7Hb6swbUZNnrbwtWM4fPLsUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OJTI3fVU7PXFX1tjVUU8Ye9r4QnjQGrtjmmqI2Oz+XU=; b=nvRiSeyuE7KMP5NQx5Uil1pMPHsuT/kOpKAwVkug7sZbRRp6ARnrbnvk0KpmcQgu6TmmHaqZ4H28cmh+U5Fq7bLlOIMCx7xrUgP6Xy7trpR6Uf6ZVZ7nl1GTSxGnQo3tedljQQlF2un/KAhUPkwiwDmylVdPVIq6GLNhxHKCRaTpPgJ/A5k+8C5MKlJ/tDux7WKocT12sy+WNbnvKPw6TzybPMuLKBM355hg260ZQqtrFQCiOeL9gW+4KStQ0jfvD3r4Uga8VIRhLeuHyQEg0cY2WwXjbPXRlFrjN8NfeuIVRdl2ESQ7F62WruoJQhETKDKUv6EVnxa8vg0JQWdD2A== 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=OJTI3fVU7PXFX1tjVUU8Ye9r4QnjQGrtjmmqI2Oz+XU=; b=ZQht448RcfE8uFrQ41XWg4nb5X60h1DgUMdTH2jXFqPBjPsTwfS4YwLhz/mCTmfPOXMpvpdH0ubxbI27Rw8ULw5ENlI0j1JQJYThSR6z/BJ5zoWgzim/BaxdhHkVYYltkkFStafd8tKV73wCMmKKpZ45zRaKX444haUQtJy+Z8A= 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 TYCPR01MB6400.jpnprd01.prod.outlook.com (2603:1096:400:98::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:23:18 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:23:18 +0000 Message-ID: <87v80a72a1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 7/9] gpu: drm: omapdrm: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:23:18 +0000 X-ClientProxiedBy: TYCP286CA0061.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB6400:EE_ X-MS-Office365-Filtering-Correlation-Id: 78cce64f-0d1a-4ba7-e9b2-08dcb82afeea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1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PqTLEhFTqjVYearhop0yw2seZY0baNvHqjn9EbUohgseJ8katZFmG7P0XzFMp/k0pmw9AS0bs75OTEJZEFaXoCbiccQHh4E0+Xk2JPrV8jMosOELaQVWcQLnRU7trb1KOrBKNmV/s8Okl7AMRFqJyQwUpoaCkN53rta20N3p4gYak/RpUkKn5EXaIBQNIKGPvK08Odk32DwKx4YGSO84SKc1Er3PtBy89g417uQ3PS9NaK9GEnWWmQsdVPgfzvsDGKCU+0NgfHCRaW1owYM/46JF/Fk8z7/9FqDRZYqHhbDqiFdUFFjNiQV0PbbkxBLTQZY1/h623uTRd78Erv3vk//KlUvi9xyBYxAA8TPJ/3z0hL/eMB+Sw71gmV+IzqhmJg6uqf5rBobpUAQuX+3Acsesk= 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:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fnJpPTPUAvoGA9zXKD88pfQpNjN6ZrCgl2mTeBXoTUbFIgm6tbwKezYJeuhZV5lOYTVv/2H30vVBp1lyDaC/bZCmaqvjcxh6Z14sLGYJhcgWkPA1SS/KCQOOYj8/UXKCiN4h+Li0hZZRMZYwkQ8zkqxDAJB49sVNwFbyxeghviXAGzuo/WEqF6aa0sPeIoeSZgOQMUBVlx6wuy2eer9OiSMHoQ1KWcNyL110ZaQHTx31KrsP4E1IBEmwJ7D21l+auP9SnogY5ypMCwdQ/c573KGkrGfRkZieU7zBUwkDLGnhEVsoyjArIW4iGqLJXdP2W1nFCDKI+ZYhPEFlXE2GAEvaiDGJLSa9EYHD+VO2JFhAE2pWGswfBzxd//5FSqfN7fYUZQ1AgKXSWpflr31AhZLGv0zhXuECF4qt6EHQrdsOAb7m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kyhN7OCGKXJ0jBoOPt38KYlSBLMnMEpZ2d593JlEGB0PubIk3O5zUzD/fVhCnb3eQAHl1VRNowGOm/iREDrR62B8lL15tKe+oJUcKoL7/PzR2MyEhN58i28aiFRkTPHAgmFwK/AxXi8c= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78cce64f-0d1a-4ba7-e9b2-08dcb82afeea X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:23:18.5635 (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: jUSA/4hJ2Z9MjjR7zxlReDh5lgad/opFMP4s6kmTH0w+V9vsmM8NOmKhWzGXm8LqCkMNeeskKvP2RyvzWiMQnoEDnpTByN67ltm40Ka41ryK2oXYzvs5oNwp5AjvCgpZ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6400 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212328_057446_CEF27A9C X-CRM114-Status: GOOD ( 12.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/dss/dpi.c | 3 ++- drivers/gpu/drm/omapdrm/dss/sdi.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c index 030f997eccd0..b17e77f700dd 100644 --- a/drivers/gpu/drm/omapdrm/dss/dpi.c +++ b/drivers/gpu/drm/omapdrm/dss/dpi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -709,7 +710,7 @@ int dpi_init_port(struct dss_device *dss, struct platform_device *pdev, if (!dpi) return -ENOMEM; - ep = of_get_next_child(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) return 0; diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c index 91eaae3b9481..f9ae358e8e52 100644 --- a/drivers/gpu/drm/omapdrm/dss/sdi.c +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -346,7 +347,7 @@ int sdi_init_port(struct dss_device *dss, struct platform_device *pdev, if (!sdi) return -ENOMEM; - ep = of_get_next_child(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) { r = 0; goto err_free; From patchwork Fri Aug 9 04:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A3BFC49EA1 for ; Fri, 9 Aug 2024 04:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=DBd/lEqVc3RaMOaLqg1MAAM6Pp 8YSJCH36ETltfN58UXVlvhKTcdpbUcZpCPoJ3xrmlOw5AZS0TOdvmdx3TGdNcbBUXSWVZO0tIR9H7 nTw0X+6/PBqK49vlqsC5J/RmUeNP7feG/O8J+8vyVI8D454w49UObjqVm8WMIT81m1jd4UoWknb4p N6ng0p+xEbEj0aHc9Z7PYsdsLo4z5UlZxFgVxU2mDRMsyPSP/ajfuc4QmrF4jrVbvNDjxArNzlDYw tU8HhqZn39teKHnvKJryRdoElDD+V/t3CGI54/HeOlYLkHnx5v4bd0EYBJ4cjPyw0DjecAx8S+b2B v05I+Pzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHDd-0000000ADRp-1CXn; Fri, 09 Aug 2024 04:27:13 +0000 Received: from mail-japaneastazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c405::1] helo=TY3P286CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scHA5-0000000ACnP-2S0c for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 04:23:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CL8gjZl+zPsZQ+sUjHufG4dvGKnlzDHjQheyqAYBFZ2sZiqxOsMv/hs7c4F+3leB+uQDGD7q4I9cB72QLjXvI9AayUqfunvgQsBJ7IiACXz1on+ppV4jnnV5j7wp5vO8Zy1/vgAU6Uru2aZ8JKk8FugGlhS9gB1tjlxhu9g+s1tOjf9LRxjq0uVb03y9SjD0ir/DIRPpHko7kupjO0eA9dwOtYWMv5HdsUnG6dnr3+FfT5k8NJ+v+UPJeo4wVRBacOnqwPRTcMEaCCdfbNJgKINQWs0wxnfWtLqt+LdMLh1AYdDoAygshNq4wFMJlgpSWOC+puJwmpwv3bdVzCSpWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=O8ow9SgcKWeykHmjxh2nH8EyCgp+VBRj5c3PWL1/aCiZzDO/SGlhHqSP/oJNkTMsqgfOBeCvLyQaUUwV/tTsKwKpH+x3dJkthzJ15LUramH8L8zgPkURuQVeWxPGDxxB44e+n2LIb80McSnYd0pwREz7oHWbwbIiPQQzlehgezt+TracGIuuZ+srIq4kVqcI+f8Y4hHwkW+oj0yJJhh06csFavgnnJB7tl6+EHYkBVsuolEyiFEM5gNSi2g920vTvpkg4XncFNwrcYeuP5abppRDddhW1kmF08RG3mY6GoOucoLYXoiESYM903NYDRttkWxfHrsOHkafjJxSSk4hLw== 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=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=IZnOBqz00GKPu18D1MG8FMHpC3NTysmmE1y2BB4VwiIh+TEtn+iMIuqINcqBDY3vMx/1bdbha8NApJnxwbIt1t8kQ7aFDTTLMqf2oGA9KCTF482HvBZursQE2mav25jQ4drhffrUHRV39U7pr6lOnBKdnScpb2PUPoFP/ZhyDT0= 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 OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:23:25 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7849.014; Fri, 9 Aug 2024 04:23:25 +0000 Message-ID: <87ttfu729u.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 8/9] fbdev: omapfb: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:23:25 +0000 X-ClientProxiedBy: TYCP286CA0099.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b4::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: a6d344b1-1e6e-4100-12a4-08dcb82b0349 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|1800799024|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: hO3TwniK2jtjd4K1zlz2D0jq88l+/Qnuo9M+mJDWf9k1klKJr5f0lAn36r1YzMAQMD8EYeUaB6TT97ZhxWBQIYfpQGiQuItoMEKEoG3eK99R+kBY1Rj39Uh8QRJNZ3Aszm6xymSwurRf7ByJJ/vYbgWvB0W1WgVuojwH1e3nbnY9rIWZBELTaKVyFUs7YXSGq62fFGdC1aYyXOp8V7nQgniL8rnveYz+Nfx1zf9f9IzoHBnfyK5PNZoSi51n/UUoDsW3yrg/Cg7y76WDozG+lAcY8lsZqpD5mg6hw+oer5Qm4c4K80L6g+WYelk+5ZVitgShMklQCAVNUKFkCO6GSTMgGlOKU0Me+ryDXy/FxbdlboFpJVXQVx1jAC6lSaeUjUyMReVbGmfPpZnA/9J5Sl2GFkHna7lvMdYiuGjlP2Hf0zXmQrNOQ7Nw4wucENXANr7uynDFxwCp9S2APfbibyJDu2j9L2VlbiJyVPTddRR+ACXSj+oRIDHudv/AXO1x3l5roEzlxeI1T9vYYfg4lghUjC95msYGpFnsnKcPgP7mWAlTDlgBq1Acf0WerAKFZxhdOQW1X7yyACKY2tKrAcSMFJ/tTDX4XrYB67Kmc3fKY+urlBsmT/LdzO9rJqikUJFJifAby2W1mvFCkfnlzeSr4najPMgQAJ32mphGfwXxGAARZR0n+OSVaoJZTjzlOdhqOpfDfUbaG7jRFD0DfjXnQA4maGNxZ0wl6+y7DXC0tMhfGlPGzF40jJhUQJacMiHv7MxMYkC2hll1aDgbvEkYFpe4GUJzceZFM6834BlWBHxlCDiz1MUJCQs6X5x6495rZRq9Jhv2EYe3QCnKITb5O+HFriNnR+rD0dnrhZzMqHK5wM5dbnU+MAeBEE8AY8RNlg0YhTfOql2HhYwKQBQTh4A12iDKeRvRG57XWt1aJ8JV9UsgrsuTrhD9ZYjSIhwHHsjH3MPgByPka5tdaXGn5Cw1nCJ3QjekhGaLU8Bp7heq0pv2eCLaRVqrGuIQkL5BnP1zemPc7qpj7ZEiWXhBv+MyOj2XSdUAi8COcY9T4udqpde/Zc6e/Ergu7t1yu9lboPIkpCnt0/sVIRnxFaxGeaDv34jXgLbkchV0+wh5YxJ6cgTvUIaPV5T0FCjhPlwd3vSTc5VzNV0pLE31iyPI9L2av+RZe2ilBZpmBGSg7lWod1TC/1tQZi0hQGK96otU/9MWLApWs5Z+z4aKwgID2/idsrltyxz8lP+gIEgJd4JHx4pvaYFEIE0WfTq60nuytLuq6D+8A7qr4/kOWv6W1S6Pf5pkxJeljqvAnBcFmtYZy9XSe9eGgFzaAVTlgXjwVoreaRANdRsn2scNx+PzbJIqOMAnQV0PBsJ/tyHXfN7ey925Zi8Pb1X4L7x95BUPjoi+UHuo1u5cZ/HdUhErj+bTA9FyJOQDCCsa/k= 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:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a1nDOUIozb4HP8H4qpodupMG8Cz81wXtg61yXq4ti5ZZjgdzF278aWw0aLkBxNSpVxLgbRE4wE430VKgg7cuQgfhMsHl1Hkk+gxvzjmRd+OU4kAwzdzlp2JGUJFfqjoHWOQcg/rYKdIH8afNjSV6yhKD0c5nXxmhblFyed2KXZrxnL4FQpCbjQpz4WwynUWWfLnBmqPgLF/qHK1OjUyaknbq6LvxKamVk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WIPHF2jJsY9NLaL0Pv7yN+FW2bpOvr6nRYtvFBTYQfbumyUI80fsFnWa+oJ9SASAEuG3aG+NvsT3lrtBF1FxP3I8EPpnb30J4G5tvpAOJY7NqEDw439pHQ4zqw4wlQwhShmSfREx/1HqDTE+/Rg8fZw19nj5pS+YMawFwn8AI6kmtlP5enzdhhSxpNuFHpqfVP1zMre8uQ8afxRCIT3Va49vEHGgPfXMp0VndoAStvpTjNIbE7xMvZDNsNdEwDW5fAZmffggTxRH72ZDGvZTzBROJgA+BG9gwrDphU/t6d5gNVlAEg0dSYYaUuJVSZsoXUASldDKTIIyNKOOl7+mn4QRk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6d344b1-1e6e-4100-12a4-08dcb82b0349 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:23:25.9005 (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: FPxlLvGOmbq9AhV4dbWxotOYBoaeQSdkVc6WxERNvqzY6M3lBnP8ch3Zj+TQGgRDgYR4KI0RadKeX8IvvAieOFrWbxQK33qKLrTtc1VjaJDJHG/cHwyRERobtOibDoSE X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_212333_808386_F805D81A X-CRM114-Status: GOOD ( 17.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 3 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 66 ------------------- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 9 +-- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 +- include/video/omapfb_dss.h | 8 --- 5 files changed, 9 insertions(+), 80 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 7c1b7d89389a..395b1139a5ae 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port) if (!dpi) return -ENOMEM; - ep = omapdss_of_get_next_endpoint(port, NULL); + ep = of_graph_get_next_port_endpoint(port, NULL); if (!ep) return 0; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index 4040e247e026..efb7d2e4ce85 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -15,72 +15,6 @@ #include "dss.h" -struct device_node * -omapdss_of_get_next_port(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *port = NULL; - - if (!parent) - return NULL; - - if (!prev) { - struct device_node *ports; - /* - * It's the first call, we have to find a port subnode - * within this node or within an optional 'ports' node. - */ - ports = of_get_child_by_name(parent, "ports"); - if (ports) - parent = ports; - - port = of_get_child_by_name(parent, "port"); - - /* release the 'ports' node */ - of_node_put(ports); - } else { - struct device_node *ports; - - ports = of_get_parent(prev); - if (!ports) - return NULL; - - do { - port = of_get_next_child(ports, prev); - if (!port) { - of_node_put(ports); - return NULL; - } - prev = port; - } while (!of_node_name_eq(port, "port")); - - of_node_put(ports); - } - - return port; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_port); - -struct device_node * -omapdss_of_get_next_endpoint(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *ep = NULL; - - if (!parent) - return NULL; - - do { - ep = of_get_next_child(parent, prev); - if (!ep) - return NULL; - prev = ep; - } while (!of_node_name_eq(ep, "endpoint")); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint); - struct device_node *dss_of_port_get_parent_device(struct device_node *port) { struct device_node *np; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index d814e4baa4b3..5cab317011ee 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev) if (parent == NULL) return 0; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return 0; @@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev) break; } } while (!ret && - (port = omapdss_of_get_next_port(parent, port)) != NULL); + (port = of_graph_get_next_port(parent, port)) != NULL); if (ret) dss_uninit_ports(pdev); @@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev) if (parent == NULL) return; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return; @@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev) default: break; } - } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); + } while ((port = of_graph_get_next_port(parent, port)) != NULL); } static int dss_video_pll_probe(struct platform_device *pdev) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index d527931b2b16..22a6243d7abf 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include