From patchwork Mon Jan 29 00:54: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: 767520 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 322BEC47258 for ; Mon, 29 Jan 2024 00:55:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6506C74C; Mon, 29 Jan 2024 01:55:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6506C74C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489742; bh=yvewR6pc93N3Y0GWnksPNQTrp0S2Ek0rP4C+OOW2ccA=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gJ3EUPPNzroEyyWKFK85AIR3rdujgV8hW+1G8sBE8FzwNsVDpOJQ42SMubW7qPCaI /Zu0Xxukb6WqNApwsJ3jpjdOsU5swlGdZj2TZ+X2Rq0YpfBwHpQQgt+Blx45pHDeIh Teqgw6lWA6Pjrxthu+0qVjtnh2C80uqiFcbSSTVM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D30C2F805C6; Mon, 29 Jan 2024 01:55:04 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A2ECBF805AF; Mon, 29 Jan 2024 01:55:03 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5555F8058C; Mon, 29 Jan 2024 01:54:58 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::701]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8C011F805A0 for ; Mon, 29 Jan 2024 01:54:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8C011F805A0 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=XXmjXXgP ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AlSL6IRLQhz1X14k2ruoQ33kJgmpLZhxyoENxvp2aoBF1EbLdG0UEwsguc/0JeKhI9z9L7FcCdAZVDUfSAus9S5fSAAL1jzgt3cOpvjIvYHjQZjkdFLHI+IxDS6MrcnFt/c9vzLrrg5TsG8olxZedqgz2Pc+ycAiaATd8ftHpkfIgHkmUUyXEHLek8RjWwlg3E+P2+u2PM7iUsLRDnaZXS8ciEVQFsRoqKKQETUla1lok0p40PGQr21t2MCXkq1R+NAMExYA2x+FtAuTxDIKMX3FwGdFf5967pJEqKRwGJ1sGqHjlkWyjypyTx4sg/f62vIh70ZGqhUEVm29DiwJ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kZeevCSkJhWnukHfI/O3IFXxrii7TdVIIuL0iuucKkA=; b=My2JXLwLYtKDcfbWm20MIdqYBxUjL6fPCMKeYBBqiSfIxblLYgpAQSi8/ep/Iz4U7j5qjnj03Jv/8Qob+PYIX30FBTFbSREGyzTXcYQlLvpKbuka5h7/bSPstJTBWX2wJVi3BU4UfzT5lj/ONhSmo+QKREPuMcE+FJf3k+5AoiYw2gAhQxq/Bt+bYUzkysPit51seIZYV7TGQdLi7w6PBzX/VoYTab1s50V7BIYENM0qkJ1KPS6g2XeUpUYKqlPFjlE8EKQU17+dTM3RtofuaeekTBopeniQBnPza1GxCilL9+sU5pOZuxo8Oaq1cIll4IZ0Y2rkV/KNy8hRn53nDQ== 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=kZeevCSkJhWnukHfI/O3IFXxrii7TdVIIuL0iuucKkA=; b=XXmjXXgPhkT+J7E3SEgG756DgFhJZcV78c4ELs501s0pO4byCoyZzPqVvCfl3BOHCspsPIkASljOW1w4LbkfP7U76ziX4tPQgqFATCxScYRSt/UMwgixL39JAbtgVmU3pvgOZflBqsCdiz6jfPXpz4aIf5s0xrnXl/WXdbAPl/g= 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 TYCPR01MB9304.jpnprd01.prod.outlook.com (2603:1096:400:190::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:54:45 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:54:45 +0000 Message-ID: <87ede1klgr.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 01/13] of: property: add port base loop User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:54:44 +0000 X-ClientProxiedBy: TYCP286CA0141.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::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_|TYCPR01MB9304:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d607a67-e464-424c-7fc4-08dc2064e2a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2QCe0NaOmMZhosQKIwj0Q1WixOEtEnUA7E6vvC1G1LPXJyiD08QVDf9HmtoUMWfMDjhDiSa22NVZPLzE0rYnZz1gKniFCVKOw0AECJrZ2ZFmZ4Vk6rLvpr2oiv2+Jjb1BPqsz+m793d50Xeg1YRLB/sVJc20bvW1RjW4/7v400m5WV6TxyckppYdUMQr0ngmS79gTuhEitZf+FN199J2yrU3GPa5Kq1IegIx3IR+rSoZfqW0iL1/PqsHq4TzbE/PjxMJ7k4Oi+TYKbPbf5qEBIjjuxDyxly+KADt2BcTvQB+8zS8qiSegg8qHa9zEkKN2sHx2QTwAgXvsrQpN5jpVuDiB+h+Y2tA7TD8QqzEwQVnx8zNcQUk7v5elX95uS5fgovQ5V0+SxQ+eO1mf3HwuOk46jkzuvrTaGoSWmZShbRLBQNQBXmXhfjNWN51+KJmkyRzDnV2F5Ke/xT2PFwsgtsxpS1367PiRrP6f64BjxjGMDPeCtEVGKbK68b9EOSuzyqNIzHNl9Aw/HU8ffaw53NEXFaG/v5+/z3R4OOF8rXbY95QE28LIW6QVY8QdoHYAUZDv7ocQyLYc5R+GgnW8AiuXlwdWj2A6pCFEW+qMiLTt8nayGenk0YCQQi2Y4YMt5lLjc2rHfbtZu1H0/aoRg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(396003)(346002)(136003)(366004)(39860400002)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(41300700001)(478600001)(2616005)(52116002)(6506007)(6512007)(86362001)(38100700002)(6486002)(2906002)(5660300002)(7416002)(66946007)(110136005)(66476007)(316002)(66556008)(8676002)(8936002)(4326008)(26005)(921011)(36756003)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y532ykRldd9sawv3wzzVGlFCHOSurnIqJljghRTko1ByUTlnZs0BuzFhcPBZuMSgDpvCG1g4YxNjgtMa2QpaTie3XkdFyi42A2BFonF0bVSMwzDm9Yh0fEvPekCG4kIk7f1vZWwtd/7byOjZt8YItxXwIchuxn7kiJGtld2xJ8lpOl+g3X+/AItDyim2YJgnKQA8slc8WEB/ZzkCv3OUuiaZrR9yNuQnyIPtD/H+o46+wAT4/A2aDphx/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wfrRQ+x1u/Tpxd5gbGlCvNaUS6rShsWjDJhUEQ6Pf2FNoGe0OT5jc8kK6va27roNDdgbMCJApqdxbSEfZn6z8g1CXvnvRmlS/KIjmA4rjedsfMTyWPQOqw0N6FUqXQNTxrew9EubtX98+VsTbGxYHvwib6KO2xaaTgcPgoLIu0GXwOK2TWGzkfkoz/a4nSe79twkjB5QmfZOrTqiPUMo5bLlqP4EjFHo/O6ZcYnCd0lYBX+TdqM/VBB/yOzw1yGFKQOucshOGbRhrdk0aY63B4WkTQdTPKYvGCrTlbVTeOtZMmcKJk4hVN0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d607a67-e464-424c-7fc4-08dc2064e2a9 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:54:45.2498 (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: mNb01pg5Zt1xXmh53GLmZvqhfp6CbGqRlbRDxnuEjn6ZrfKjn5HvGS7TY4LqCUjMkMvwHx64fyV/0B74rOkXfOrzOZ4AwtyGNtZq87MgV+mT1zo/r54O/Me6uLzcqsT1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9304 Message-ID-Hash: C6CZX7AEA4KMEJX7N3YTF7XMZIUTRRO5 X-Message-ID-Hash: C6CZX7AEA4KMEJX7N3YTF7XMZIUTRRO5 X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We have endpoint base functions - of_graph_get_next_endpoint() - of_graph_get_endpoint_count() - for_each_endpoint_of_node() Here, for_each_endpoint_of_node() loop finds each endpoints ports { port@0 { (1) endpoint {...}; }; port@1 { (2) endpoint {...}; }; ... }; In above case, for_each_endpoint_of_node() loop 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" by for_each_endpoint_of_node(). 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 {...}; }; ... }; Add "port" base functions. Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 48 ++++++++++++++++++++++++++++++++++++++++ include/linux/of_graph.h | 21 ++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index afdaefbd03f6..9e670e99dbbb 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -631,6 +631,42 @@ 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_port() - get next port node + * @parent: pointer to the parent device node + * @port: current port node, or NULL to get first + * + * Return: An 'port' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_port(const struct device_node *parent, + struct device_node *port) +{ + if (!parent) + return NULL; + + if (!port) { + struct device_node *node; + + node = of_get_child_by_name(parent, "ports"); + if (node) { + parent = node; + of_node_put(node); + } + + return of_get_child_by_name(parent, "port"); + } + + do { + port = of_get_next_child(parent, port); + if (!port) + break; + } while (!of_node_name_eq(port, "port")); + + return port; +} +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 +859,18 @@ int of_graph_get_endpoint_count(const struct device_node *np) } EXPORT_SYMBOL(of_graph_get_endpoint_count); +int of_graph_get_port_count(const struct device_node *np) +{ + struct device_node *port; + int num = 0; + + for_each_port_of_node(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 4d7756087b6b..fff598640e93 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -37,14 +37,28 @@ struct of_endpoint { for (child = of_graph_get_next_endpoint(parent, NULL); child != NULL; \ child = of_graph_get_next_endpoint(parent, child)) +/** + * for_each_port_of_node - iterate over every port in a device node + * @parent: parent device node containing ports/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_port_of_node(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); int of_graph_get_endpoint_count(const struct device_node *np); +int of_graph_get_port_count(const struct device_node *np); struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id); struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *previous); +struct device_node *of_graph_get_next_port(const struct device_node *parent, + struct device_node *previous); struct device_node *of_graph_get_endpoint_by_regs( const struct device_node *parent, int port_reg, int reg); struct device_node *of_graph_get_remote_endpoint( @@ -86,6 +100,13 @@ static inline struct device_node *of_graph_get_next_endpoint( return NULL; } +static inline struct device_node *of_graph_get_next_port( + 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 Mon Jan 29 00:54:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767519 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 067C8C47DA9 for ; Mon, 29 Jan 2024 00:56:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 70E8D7F4; Mon, 29 Jan 2024 01:55:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 70E8D7F4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489768; bh=+1l+NQrPhoy6N0GQOXrzb6DuHsMWeTvod/7F91rB2Fk=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Snf1aBMLSfnnkJT9Ur3mD8MZMvg1vLvPa4sZE8FJWES2Qo7bCGfg1zKokdlc9kdFv H7KbdXDBJsmXbrY/SP86lrqNBguewFcez8QyVFn0cjc19AmWdVMEIVQ6wZBUhc31+o g3y24G0oLJJdz6jSdb468GH2mCSJtyH35ZPj2RmQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id ACEBCF805EC; Mon, 29 Jan 2024 01:55:13 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 03D69F8055C; Mon, 29 Jan 2024 01:55:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A0881F805F4; Mon, 29 Jan 2024 01:55:09 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::701]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AFB64F805EA for ; Mon, 29 Jan 2024 01:55:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AFB64F805EA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=HGjJLnxG ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UjCptBsOMipXeEQODGhbjl72Mq7gHBVPgMXQCxLplArrLNuWMOZcOFCNMXqc5tPItdZRvhq78oPcb69m/BYYL/gZLeRSfP5W40h3iJbGYIVK5GbkGh9lONZN2vxI/SF6r3hVJyYOEp+WTHLpHzNYo+i9uV3iz4uD1+mczW6NvMDZZtXn9Zvhp1gdJljmD+Z2RlPXVfarm+Y+uHuIN6g9areEDsh7HTbI9UlGH4DWl92azYct7OBFvrYRnB59IPNQjg8k+yHu6U5OxnDW6D5L9mUymCkuD6JyJBOGuWx5/3BfQmNVvdq+YOpA2W2S2y8MphX2MU7usUXpnH6PLo7gIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=53LgFL/tgEMW5iVClRMNKc/fATDPCwYVOacfnZCL7e4=; b=CkJu+LpDx0uTHIVSdCm0cjKQxlS+fAufpu2fl8ribzcnLBXg0IJFxzxG77ExIbkGZqPKBt18bLB6GNbXYeGUJ9x9cg39Qk2kbd5qKS0EqWNPdXljua3sCxKIuKvCoeln2Aa8R1vZRuUSuuxGdJjD3J1cT6m/iGIeeDkoPkWZefJLFbO3R+yG8WBlO6PA7/fH1HiK+FQKKBGDNMWoTJYljBZe8rSdOXnx502KHpOUGNVNTpgguc1x71V3UYIQfllp/uW2miTSDatryI59VZc19+XcrepN2iWhhvMoRijjd+x7Y8vm/qDPzNM82X4rB82jNtIW24TbkLVJESSYdoj/IA== 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=53LgFL/tgEMW5iVClRMNKc/fATDPCwYVOacfnZCL7e4=; b=HGjJLnxGqABlsvQ0/wYSEkVr5qX+tMMni2gr4zTLLfVpFEZhbjQ0Q4JdH5z6lRJVEP1MNPE4sUa+XCMJFn6Sa3JbpRANoaZFCItljYt8xcWd+QV+tYO6WfpcYuOMBKqp9pHHT5qFjm+2YY3gV+FUcZynLDQ8ePPmE9XyVZQULBw= 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 TYAPR01MB5996.jpnprd01.prod.outlook.com (2603:1096:402:34::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:54:59 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:54:59 +0000 Message-ID: <87bk95klgc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 03/13] of: property: add of_graph_get_next_endpoint_raw() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:54:59 +0000 X-ClientProxiedBy: TYCP286CA0351.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::20) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYAPR01MB5996:EE_ X-MS-Office365-Filtering-Correlation-Id: d2462796-9874-4e9b-a8e3-08dc2064eb43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5ET4Fe56R4WpB3j55apOMp2zcpaUyZKou2otdPfIpadTY5+Jy/kNcWhavxVfTc+HQcmskCg1jbnlkPrreQ5o6FgoqXrv2YYc5OJDYMlllLrr4q9m3ye3lTtZx06VlJVQJNaUfa7SSXEW6yiQQzfho44ZiMBJmWOdj7jb2DPEh3WRgfeegiSmPa4xVsuJbLEyY0PiGrAHXF0wguWxJNVO/JEAMnUWgQOyZt4eInoQ390MN2Lt3QyDauUeyqUw1QvBZuVsb30WcICQXJXcsEsJ21IGNkqbEnnMFe/lCHpRtH/EYT5Hl85MKGxU6YooulLLRcEwssPPws1PM5HINQqEm5oohJI/oiBx9xyfbDibfNHPIQR/OMVPeQ4L4nlXNkHKJTTrmrXXugtLTG/p6lirTPgZWyXx1Yo60WaJtFOshb3T1KpAm91r1W4/8a3+LvRCTovsZ8GL3QGXiQx5e1ObA0SuDS0mZN5JOtWuAMWElq3lHXwYzBoRfMOHsNh9h1LVGTzPC7qJ8SSTWp2J7b9Nc6c8COUFEfjVohMy7sqyTMU2B3S0MjJ3KMRJrIH4kLgcdw0W2b3+DZcemTeubxopUshxbC7XRCx9A75rMAAw7GnM4U23SKLDeZSNC3QMn9bV1MowAiObYkXLanpXh8Q+D0tkmYkK1mD60utZcNngwbE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(83380400001)(6512007)(7416002)(6486002)(5660300002)(2616005)(6506007)(52116002)(478600001)(26005)(38100700002)(4326008)(8936002)(8676002)(41300700001)(38350700005)(36756003)(86362001)(2906002)(66946007)(316002)(921011)(66556008)(110136005)(66476007)(21314003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k0zrijg3C8GA1OUrNQlE6EuPKC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ruihEq+WTq6bZ2BySg52bOT9FPl6pEu/3N662WrmoobZYAxlJdx1ErOQeBoOhkt3hiJbhMPNqnbBWTlr2fYDgwcZofi/XDshJu04kus0FChWiHJqdqGs3TkB1trx/3ITxRJRwJaCZmlGnFoHSS92rFKYEjX9faK+PFi5ve/m9pVetxB4By1smBS+g0hRJWBx6YeWNKTjl+ohxacf/YIQYkof6ppkeJUD/uEX+o59D09s+13GlQvfjesR+z01THko7wHIobZ9UsZL2wFw7gqaJAWBktxtwN49puthXmkz8UJsWT6QIJ8XeyjkBtfK/dD9SG7kL3uzwDcyYgJkVIC/p4URtMl5j9FuLZ4M8uC4iXXmgrn+rwXxV3OPRL3GR2RWvS9hoNPkygWChAiaeBUPYw6E9xsC3MVYcvGS30ZZLoEkiRgJDV25XgCFMd9TCGEPh+EXQ7zbz1uNA/36GDwF7UTgwRSWCXjBqbD6X3u+oLTgnOqpyP4nmDD7/7w6bgJ6jsqdGynaLbB5qMcKKJRHX9Kc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2462796-9874-4e9b-a8e3-08dc2064eb43 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:54:59.6862 (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: aKzr4mCHETD2SwEsu1d2aEmm/BzaizXtPSq2h3+y6AAB/cqrtVa5qjl5FJ3PnrOU84LUz22GZ7M4XOuTem4cwoJc5hiHkYr7Hq8Zwq6KovEMtR+RdlIAZ8ngjVkfDZr3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB5996 Message-ID-Hash: JRRRZJBMGUH63PR5B6EMQPUNRWJMALB3 X-Message-ID-Hash: JRRRZJBMGUH63PR5B6EMQPUNRWJMALB3 X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 of_graph_get_next_endpoint(node, NULL); // node/ports/port@0/endpoint of_graph_get_next_endpoint(ports, NULL); // node/ports/port@0/endpoint 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 /* * "endpoint" is now A1, and handle port1 things here, * but we don't know how many endpoints port1 has. * * Because "endpoint" is non NULL, we can use port1 * as of_graph_get_next_endpoint(port1, xxx) */ do { /* do something for port1 specific things here */ } while (endpoint = of_graph_get_next_endpoint(port1, endpoint)) 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 not check node name (= "endpoint"). To handle endpoint more intuitive, create of_graph_get_next_endpoint_raw() of_graph_get_next_endpoint_raw(port1, NULL); // A1 of_graph_get_next_endpoint_raw(port1, A1); // A2 of_graph_get_next_endpoint_raw(port1, A2); // NULL Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 26 +++++++++++++++++++++++++- include/linux/of_graph.h | 2 ++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index 14ffd199c9b1..37dbb1b0e742 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -667,6 +667,30 @@ struct device_node *of_graph_get_next_port(const struct device_node *parent, } EXPORT_SYMBOL(of_graph_get_next_port); +/** + * of_graph_get_next_endpoint_raw() - get next endpoint node + * @port: pointer to the target port node + * @endpoint: current endpoint node, or NULL to get first + * + * Return: An 'endpoint' node pointer with refcount incremented. Refcount + * of the passed @prev node is decremented. + */ +struct device_node *of_graph_get_next_endpoint_raw(const struct device_node *port, + struct device_node *endpoint) +{ + if (!port) + return NULL; + + do { + endpoint = of_get_next_child(port, endpoint); + if (!endpoint) + break; + } while (!of_node_name_eq(endpoint, "endpoint")); + + return endpoint; +} +EXPORT_SYMBOL(of_graph_get_next_endpoint_raw); + /** * of_graph_get_next_endpoint() - get next endpoint node * @parent: pointer to the parent device node @@ -708,7 +732,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, * getting the next child. If the previous endpoint is NULL this * will return the first child. */ - endpoint = of_get_next_child(port, prev); + endpoint = of_graph_get_next_endpoint_raw(port, prev); if (endpoint) { of_node_put(port); return endpoint; diff --git a/include/linux/of_graph.h b/include/linux/of_graph.h index fff598640e93..427905a6e8c3 100644 --- a/include/linux/of_graph.h +++ b/include/linux/of_graph.h @@ -57,6 +57,8 @@ int of_graph_get_port_count(const struct device_node *np); struct device_node *of_graph_get_port_by_id(struct device_node *node, u32 id); struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, struct device_node *previous); +struct device_node *of_graph_get_next_endpoint_raw(const struct device_node *port, + struct device_node *prev); struct device_node *of_graph_get_next_port(const struct device_node *parent, struct device_node *previous); struct device_node *of_graph_get_endpoint_by_regs( From patchwork Mon Jan 29 00:55:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767518 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 EFCDBC47258 for ; Mon, 29 Jan 2024 00:56:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 43A14950; Mon, 29 Jan 2024 01:56:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 43A14950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489803; bh=ffS14aV1Ln+TfLGSo/g586z4rf34Vf14zbKTRPb7wEg=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=M5GFnpsK4mGbl7DieOedt1/vmIj9Ff1WhPGmLxlVX0MXe9RNo8MpG2b6Ii7b1Cg8W hT9qk4CR2MzCF2C1k2UYkQ8ceYT3Yj+TGW523t4bIIj6FE3xAsOAYRjGm8bHzrPR3r G0Z/Sbx5UjC/gwIQ4MXN2kz2LAwLWfvSKbFlwnTI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 85356F80621; Mon, 29 Jan 2024 01:55:24 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D7A26F8063E; Mon, 29 Jan 2024 01:55:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F3AC7F8062E; Mon, 29 Jan 2024 01:55:19 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 91E33F805FF for ; Mon, 29 Jan 2024 01:55:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 91E33F805FF Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=QyBJAkdE ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7Oyn4gWZK+eIhpByhHaIu8U6e2FWj1me7N/G1n0aIcE7cUEn9GMlY1+Io50kYBRiVYbMn1TT1NwMWfq2b66NRGJ7UPRBCeRnYx1KXgDJA4hG2vRuwTleOtxASC7VlzHoy4bKwtlgoYV6tBjG3AyXZGpcPFqTlCtAsZGdswpRHHS1gRIMzlAGeMcRouErPe29Fo78MLmM1yAEkEYTLSjkO0JtLmbzY6ikbn1Sl/o2HN3bUkfhvSeHbaz1wMZkmy0MpNCcYXXZ2itPUFg6y2h39BZoL/1PH5HJz/xf+gIpkTay6h7MCGk5Ng6/BGTUieB7jbFgHTy7MQnLPmaxEOsMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=doHBcvAYo0yrIjFUYG+DMNg2fMRtjrbfAePeAn8BweE=; b=Zt1RzM/155xC2ZWkq7NTvKQKLy+GmmhHRpRkZp1mm8aFnRyktCqKk2HLOJQ7EL5B8h1qvuKNMemkzFkJwgk4QdcVRi2DXKYJYMzF34uO/rmlOC8kEY+K6Ifhcw3PbkmOifQJq0I6sLpbIxcEzpNEcRBpZ6eQlCtsU4z0R79ouKjJ9E5rpx//PkDAyhHkfaekYwjQwbKGrUEBbsHOI14AO+adNo3DOnSASWVopz7DkrVI22Ulrc33YMH6xIuFEuUybPlqMzDSOKhOxHymFRy3S5SfpHSfXuoh3qlHTePWpb7EH1daAdC2dy9HJO9eIdVLnDk4D3dM3qVIut8XBNJQCw== 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=doHBcvAYo0yrIjFUYG+DMNg2fMRtjrbfAePeAn8BweE=; b=QyBJAkdE2c/wp7iHgpfdwRll/MajIFGmXwrwJnSVHbOIWBLwfgrXmGnwhJzreK6B4YPrMPSPoR3RysCHTQ14ruVW69QzZjrfxMeV1P3Eds7rqnxMLwPQ6W2FK9M3gEa7o4jDzP2w9Cmg40Znaz2ySpYHpN8g3pZumRvDSNrdOnQ= 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 TYAPR01MB5996.jpnprd01.prod.outlook.com (2603:1096:402:34::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:55:11 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:55:11 +0000 Message-ID: <878r49klg1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 05/13] media: xilinx-tpg: use of_graph_get_next_endpoint_raw() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:55:11 +0000 X-ClientProxiedBy: TYCP301CA0011.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::14) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYAPR01MB5996:EE_ X-MS-Office365-Filtering-Correlation-Id: e4120e63-ad3a-4ccd-6b09-08dc2064f242 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6a7qpKU+JzITN/5CfOCoBeF7UO89LyOf98BRvsEbuxHSIVJ/02lyBi5lwADl/YoAkAcb7pvZK+3zo7jqcAH09w/w7BASaqxqqJog5mOUzO4ax2b/bAKgomvwUaKW0lzK7uNOtbdFIc6wScuo3pT31cNjJ7+eQfOB+qbaaFZU4CtnLsiPezdgArTZRPI85EzcdVLfWZ2uPKM6wrf+3jj4a8DN3UJnb9D37m1UnhIXc3tXPkfukr0+oacYb9fy5iK9lZwouHjDcCj66LBQRwex40s5EC25Vj5koUXOuFxjGzzhl6FeFUR24kDNLvL7qLPnvzCQUYb/a1ouVRDPHZaUqXECoSdS+lnEsEDmKVfxMfAkDjU3A8DjG2HDSirLsCBSpJSeTynB1/7gwFyqYHfLfwy0gT3D1z6UwDz8yHAfE9ZoYcl4ILXA3KYprHeS0GCWsCRpWa/RFFc7z0C3gp4XAU+YAlSiT5JwzQUgFDHRKhoczoalAp1NWfv1BCcNFtDu85s220+CtvU67oGNPk7YV3HsFQC/IuTP6QhffscF0ok0STvklob2ERudD1rMntS57Ewrv4C4MkKjTnXAnZn+OAOdGfddpkkAMp7ImEHNhTH2tb8YHorFyc6qkvAmhIsr X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(83380400001)(6512007)(7416002)(6486002)(5660300002)(2616005)(6506007)(52116002)(478600001)(26005)(38100700002)(4326008)(8936002)(8676002)(41300700001)(4744005)(38350700005)(36756003)(86362001)(2906002)(66946007)(316002)(921011)(66556008)(110136005)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KggLLHbv1+OsUqtflHxvz1vvDryAGWkeaH2hWXrOoZ0wZYcvc3zXasaBZZvOCCo96IlyUw6vgPjElSpeczdbeS1LtVwSFDU0+3UiRW2iTaRUEVvh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H9JfGiKnPqtEWMq89g53e8E8B6PmdAUUnJlvSgLmE9faB2UMRN03NR/O6kewex1f7vs2fKtl5HstaKYgHDD2t9ChWprzdyQAnJy1299uiDdQJ7wEGuPB+YLmBGifqRtjcZfbLlaIQGtTW909WoOwNB2/Tw2zkoAPnq0CosPcedbHf1clN3r+i6UzF/cvd+NweykaQkwgkoAHdgqxiBNmVlES374jcJQFo6WItSvwd5/cSPUVOa+TLJPyCmJ8HlBK8xlfAiFmi5uBnVeRNH2S014t4JkCrInRZPbPS7b2MbItZvAOGcO3h+gRhG5HuZVUjfmB/sg7KnuJGr7fxEtKxXG6VGgEPXeDAvN3664YoIglkPCk0z1mz19C2mkoRaHZmSCh+BHVYVYGwIDYdKPlgNMAI8jtyio3MnUsEMTJEj6/Ak/mG5sXTmRDYdh68gObosAU3scN4gU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4120e63-ad3a-4ccd-6b09-08dc2064f242 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:55:11.4144 (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: M8ahWDWQbJ/iPu8ANJOnt4oQEvCUEF7qTj6HnMrD3GTxttKwCvpL9UcztXiMXr6s3LsPFFwrxk9WaTiRwi4pkRI1H4p1K6mnBYWBtKoH4+OKqYk9qdAPjzRQmujYJemf X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB5996 Message-ID-Hash: E33IVFFEMLJYXPLLDIKYIQ25RZRIWKNF X-Message-ID-Hash: E33IVFFEMLJYXPLLDIKYIQ25RZRIWKNF X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We can now use of_graph_get_next_endpoint_raw(), let's use it. Signed-off-by: Kuninori Morimoto --- drivers/media/platform/xilinx/xilinx-tpg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c index 80353ca44402..97908533466c 100644 --- a/drivers/media/platform/xilinx/xilinx-tpg.c +++ b/drivers/media/platform/xilinx/xilinx-tpg.c @@ -745,7 +745,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) } if (nports == 0) { - endpoint = of_get_next_child(port, NULL); + endpoint = of_graph_get_next_endpoint_raw(port, NULL); if (endpoint) has_endpoint = true; of_node_put(endpoint); From patchwork Mon Jan 29 00:55:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767517 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 5C954C47258 for ; Mon, 29 Jan 2024 00:57:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2D6DD74C; Mon, 29 Jan 2024 01:57:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2D6DD74C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489839; bh=tynbqH5KYpLUg6XYTK9TNh3jy6TatTHv8KxXvkIsYI8=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=t+Kz23Vb+XB3DKi/SM4Wyj2+aMMFtTp6pgyMRakVUjivAbrVakCAt+gt7ofN+D7TL iYiii/hb1A1cJxjx87pQPRtylJyUag7svt9ULqe9KoAI4trwonGAAJos3zhTg5QFk0 rhm4ZP5wWWK1ac91MhxsizzleSlAhGnFxsgdEToE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A9003F805E5; Mon, 29 Jan 2024 01:55:56 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 12D51F805BE; Mon, 29 Jan 2024 01:55:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D43D9F805BD; Mon, 29 Jan 2024 01:55:51 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EEA6AF80637 for ; Mon, 29 Jan 2024 01:55:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EEA6AF80637 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=DB2ioQQz ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WNxog7pJRR/Tf/PRM2/xMM+ECmF2Dbl9k7/Y6Lf83wMR2dad/+ZjFUE0UG24Wc8PhJnDLAwarGoscmTXQpmzuHL0fYdS2vpY5+ciK4gUqN3e78agyDo7Lw1za0ZvzuHosk203eUvP9dKPPHUFJH9dxUPBbsgVvLktYIVn/+rO3GqiLYEgb0QNe82VOIT1QZLjbj/es31Td+cmeAfQru4/OOGmP4H+9wdxcKthiWe+DY+07qH7hbrjBqqV59TOLcimu9/LjveXQwRuHup/gbADyoC6U7eCua5iAJqUqtx8ONGsWBvzKzMRkpC6O2Yn+zGFiDfB0kBtf8LhW81RuG/yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fpk68IL/BvflDbGBACJ5GaP7BhSLRxtc71o9QOSAGOk=; b=cTOfODYpM87Guz6F7GZc1aiIpcadKbsDwIZ/C4aao7roRLp+zo79ZX7hLxdB/8qowhbZQvnzp7B2HNp2+6ZI2POEyemWnAlymOOgMA7L+YABVh9Daddsc6qfxo1nre+s02xzt+oO2fesHNYPY9ThuvcrluJezNHG1fSzYcHUwTMMjZPdbtFjRBgUt5cCY+jG99u+DowQwYfcZBnJU4kM1ji3J7VKEW7XBXAC1c23NRkc11AuE4yDkVpv/X0Y+0GVKHtAq/wgjSMdVlq81kaRYcK7OSI6I0QIg5sRaTYXKgepO1/wBVGUJtRYgUfgrP+y86hzRWBUsjJt7JyZQYYLZg== 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=fpk68IL/BvflDbGBACJ5GaP7BhSLRxtc71o9QOSAGOk=; b=DB2ioQQzTjiv8vZtFuPIWmSiBiPVR3Zn8MAouUFTz53ebi0jA+2g4+YxIU2vlszv/KjEmwjVUHNAjyyTTDJ14vrNBfx5+C8bMgJmFQETv2EK2av3cS1cHfe0GIcWOjr2wV/zXhHMV5hqX1EQGOv2sQ3w6wa1qM8BNfwj7ZPSmI4= 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 TYAPR01MB5996.jpnprd01.prod.outlook.com (2603:1096:402:34::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:55:22 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:55:22 +0000 Message-ID: <875xzdklfq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 07/13] ASoC: audio-graph-card2: use of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:55:21 +0000 X-ClientProxiedBy: TYCP301CA0005.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYAPR01MB5996:EE_ X-MS-Office365-Filtering-Correlation-Id: c14da518-c333-4f48-7855-08dc2064f888 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xZjqiPdcfJWhOLGQqO/1oDbfV4D6p4XOPzBROMykKLHcnWeHF2X3Q1TdD7Yv2PpPqZT5Zeh3slE+OIe76UL9nT+w6pzPU91gdTXqepYru/KhjwwG7he1OYNvOKrlpXR25JD9BTcYilZUTnuOURp0ornXvDpNW5rqcCBjz4lA2pWPzmAGCArHPsO5LlOiamWOQNgiDeEwDrg3Qa8oLf/Rju6jiTQc23GAm4MFavzV2/9+OKTUZPaqiUuFJDPemrsgB8zlMR3f3P8C9MWq7C/HFVUvJxvW6uL7+rFx/uSD0zORPjmTiLYCfWZE1+v3tK+dY/pNtpcsyiYJmvmXTv+mNTtbDXGuEgYEbGSpdLLNMfHHcpJ7Vmb4z2KX0XS74kp6IQbZd3fUynZgBfkPJqHMyK1ahbVfXtktOM4M6xOFfmngZn6RtiVND1uk7W8J2zII9l2tSmmRUfZESBcMC2W4xR3VJP0AKfD6Xm2LuWIYzckZO0DiSLQU3JMaD1xJikPEzEZiiVP2qwhTo17AfH/kZYTPZ6EldJHN7wwoso89V9K+5uvCh5Q3rKHoi5JAnogeUvJ2bYiDJX0kw29ODPO35aHs0VECwa1dK/IVLnM2dM2iraip8jXUuKEjwMnZkGlNV/MaT5paV/E/A078VFwr44YrBQTkwq03gHMMcufR+sU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(83380400001)(6512007)(7416002)(6486002)(5660300002)(2616005)(6506007)(52116002)(478600001)(26005)(38100700002)(4326008)(8936002)(8676002)(41300700001)(38350700005)(36756003)(86362001)(2906002)(66946007)(316002)(921011)(66556008)(110136005)(66476007)(2013699003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y5ypzHls831jW8Fy/x+/h3rwpOKFUhLemqdgPlBRcj7MLC4hkb5OtOVXtW1lCVwgQy/dAr0w+rstpvanqYOa9ZBcZPQ2Gv8lZ4wwQ/q2BgOaVAegdYLtxbHvGySRK+3kYGy7K0ja+5fmjkzC93Pe8ziiicizEaz00UJkgZNnbMpIpvplz2UB1jNb33u+fBhhlYnsB1LlgZK+ZVwU2oy8MQF74GVf5TYQrUS9zJBGCbOT9jslV7SQE7a0ZzHC8e88DLRvbtcUYbCIdIbyzbtquK59X6UVVZvx72IIJNrN+W0LMz+pcP5swp5/MsUwxZCwhWMKyOpEkNCq8cABH95BL5T6qTKUqYIfQ2M4JoNb2nUM+E+2hO/CCF0NPKBM4Nw1dxTU8lf9zzarfYioybWbyk7rH6oe1G5f1b10FUzOBlCMcgcP9rbzCYBQGOjPmRh/rCMJy8FXhTqRj+ZauoROAIjIvcT/PouRUEcVkwCewTPVTFIDlNzQ3ogZsw7D/qcYYhvlTNoAebpOlHrjQyIxeftaB2UjIef3GPZ1amYVFznEiLqYTUz+qXrymqGrxv2hJZ1ICs8i+1XFze/wO4WVQJnyggHm+HDn5C67H47nvRLDmwWnoOz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dc2064f888 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:55:21.9875 (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: 0L84oiVTvngAOn+BansiKXFhAzT122c6s+0j40IEclGXGtf7FPSbewF9+Rm+BHXM5o3RRtypCrFtTVscsLJtlTDAJFTmxOA/HKZwOX3KHBD9tBQT3rYxOmMTPnXU6iMA X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB5996 Message-ID-Hash: Z3IDTJBPEV3E6RGVTIB3K6K2CQFPIDBC X-Message-ID-Hash: Z3IDTJBPEV3E6RGVTIB3K6K2CQFPIDBC X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Now we can use of_graph_get_next_port() for port parsing. Use it on audio-graph-card2 driver. Signed-off-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card2.c | 29 ++++++++------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c index 62606e20be9a..59a5db12bb5c 100644 --- a/sound/soc/generic/audio-graph-card2.c +++ b/sound/soc/generic/audio-graph-card2.c @@ -339,12 +339,7 @@ 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); rep = of_graph_get_remote_endpoint(ep); @@ -539,7 +534,8 @@ 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(of_get_parent(mcpu_port), NULL); + struct device_node *mcpu_ports = of_get_parent(mcpu_port); + struct device_node *mcpu_port_top = of_graph_get_next_port(mcpu_ports, NULL); struct device_node *mcpu_ep_top = port_to_endpoint(mcpu_port_top); struct device_node *mcodec_ep_top = of_graph_get_remote_endpoint(mcpu_ep_top); struct device_node *mcodec_port_top = of_get_parent(mcodec_ep_top); @@ -572,12 +568,12 @@ static int graph_parse_node_multi_nm(struct snd_soc_dai_link *dai_link, goto mcpu_err; codec_idx = 0; - mcodec_port_i = of_get_next_child(mcodec_ports, NULL); + mcodec_port_i = of_graph_get_next_port(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); + mcodec_port_i = of_graph_get_next_port(mcodec_ports, mcodec_port_i); if (!mcodec_port_i) goto mcodec_err; @@ -967,7 +963,7 @@ int audio_graph2_link_c2c(struct simple_util_priv *priv, of_node_get(lnk); port0 = lnk; ports = of_get_parent(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. @@ -1099,21 +1095,12 @@ static int graph_counter(struct device_node *lnk) */ if (graph_lnk_is_multi(lnk)) { struct device_node *ports = of_get_parent(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 @@ -1197,7 +1184,7 @@ static int graph_count_c2c(struct simple_util_priv *priv, { struct device_node *ports = of_get_parent(lnk); struct device_node *port0 = lnk; - struct device_node *port1 = of_get_next_child(ports, lnk); + struct device_node *port1 = of_graph_get_next_port(ports, port0); struct device_node *ep0 = port_to_endpoint(port0); struct device_node *ep1 = port_to_endpoint(port1); struct device_node *codec0 = of_graph_get_remote_port(ep0); From patchwork Mon Jan 29 00:55:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767516 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 51DA8C47258 for ; Mon, 29 Jan 2024 00:57:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9D87485D; Mon, 29 Jan 2024 01:57:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9D87485D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489870; bh=2BjPQdIp6UHDlcmv00uBrxqQJzZ4qHWJAJniszuCto4=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=lvWxF8NAQLnDJyNtbtexe4Gr4XvfIDcHDw7XcU+jrGASE4yXupT9GzxvnsYpy84Fl ui6D64F7DVyT58CfTtZG6X+Mtf/JvZnBRhANzeuShlWq+cX5bhPn4VDvbQIdCZtWIN uEIDE6qg0ruhqmCSgVgof1oDC5zyjkZDHtJhOC0U= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B83DF806A5; Mon, 29 Jan 2024 01:56:09 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3C64EF805FC; Mon, 29 Jan 2024 01:56:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2880BF805EE; Mon, 29 Jan 2024 01:56:03 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::701]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0BB47F804F1 for ; Mon, 29 Jan 2024 01:55:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0BB47F804F1 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=IQZ2oXHL ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c2XUoi8XANY9vfNRf7FPzqdYeBB72Em3kw9fxVoRQz24UdZb0DI1jUvDIt5P3A9G/XSTl5Ddj0gi4cKAdbb9LiNDsgi/APAuaLcTAyhqpuJBWIrpJf1Wb0DICTHrWjGcgWWcRthL/WIGV0+mUDkB7i1QxA+FtdmvI9MES3+zHle6kkK3hB8EIp0mRnGAc4Fjh/FNPdoedbQ/I92NxfRjGRmVSanw5LzBeAO5/UXg9GDqgXlr9fPq6iMb1yfsCZuvh+z/MIZT0HDN6ke7CDPV9falz2TYLi4IF3uQusv5x6gS+3Od0tfNkdzxJmILb8PbXO/tararTSFjYu2TZWsKFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TB8eKp1LM0RONSWqEImVz5fkdtmN34mzUPQSse4mj/U=; b=NVbC4lhFA+/FIJcI7wL2PYL5NvMgAf1a8qvB++XoyJ3lMhIl7cMsCvpv9UbXpSbByODb0rYwhAmsQwr9b2O5kR2v4y3IxXRw97ljtsglJhpXNiw2FSWxuQLffKBFFJ2DzlFbUJoYcLwQ+PvieoOojtGMCfbXYzHh7+UgmhHrTNMjVBEvVQOeV+w+UuxJo0k8ldCA9Ue6ROVBT7dYBZ5avgLSD1PKzsaN3M6W5fOqQVX7DQ6+i57RLdB0hu9mLE2KyI0caZO4r+H0x85vLzhsRSPGJ/1IFU1X3/+RDYYTpBgrtxoqrtnqq1QAsKgKYYQlKibLoTEmlf8uJsOlR2anYw== 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=TB8eKp1LM0RONSWqEImVz5fkdtmN34mzUPQSse4mj/U=; b=IQZ2oXHLSyDcCDw1msbdI7x/EPOvIp76nTT+j00PuR+JGk2TvIJ7XubytrxGtRHhRCb3wUsdAu4fq3zosEnPU0Tau6zbJaa7JAdd+m6FjYyRtFidkeNA/5r6qgRcKpxQV1OjoZnWO3QcaJUZgSX/QgVB8Zn/xo0z1miorvK70Qc= 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 TYAPR01MB5996.jpnprd01.prod.outlook.com (2603:1096:402:34::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:55:31 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:55:31 +0000 Message-ID: <8734uhklfg.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 09/13] ASoC: test-component: use for_each_port_of_node() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:55:31 +0000 X-ClientProxiedBy: TYWPR01CA0008.jpnprd01.prod.outlook.com (2603:1096:400:a9::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_|TYAPR01MB5996:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b3bbee5-d5a8-4567-2962-08dc2064fe56 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A8PBvK7fHSt5ERef+OcoLIqJl5/xtmaX7UcJ6olB9Ht0HrekZq4aZ9fJysufXARpMIBpB338pZOE1aHNpfEs8e0GmTwaDXF+M2429dN9BAkMISeckAQVQUrw92TDNFM8/f07VYCtyWwi2jrmklh0ijEi1aa2UAsv3/EqsaB08sgoCGv1Gt2lYQxnciMezTVbR8t7ycgVfurOMx+3W3v+kjCylMDvoBM2jfQY4FgwpXVlhuQMjo9e/SYX1dVAYWrqLwWkZbRyMEGgSbotRUt2aEO46q9F+Vo6QA/T9kPQ3w1Zht801hyQbXhUiB9N18/mnX4BGcuWtggBlRTAOqXgCyEnYR5po3kSae8y10jNUjydV6NOM8dGPHAABig2X+eFyRJwxzDHENtgHW3S7MqrLlQJxR4AWWrY2Zoe2cZ6xO3Klbg4bMbBq+FIDUfNHbsjqePwACvxn9KDgE5bAft1VLh6ZH0CQG4sl7Ce5eRWHFWXOlxQRROi8j7dU7tiKkCO+eA9r4MdwLztdSMVnEgjCDmyKGc7svGhV0ChzUN155Cn6VVWzcP2CHXG+6DnHnqr/KFj5bTmW5XyCJqvzoc04gOfzjMFE2H95+0E9+r00dkPRbnC/RvPYI+RlxlR/CBQgt2ISMIm5JKX8hJp5BF/ZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(346002)(396003)(39860400002)(376002)(230922051799003)(451199024)(186009)(1800799012)(64100799003)(83380400001)(6512007)(7416002)(6486002)(5660300002)(2616005)(6506007)(52116002)(478600001)(26005)(38100700002)(4326008)(8936002)(8676002)(41300700001)(4744005)(38350700005)(36756003)(86362001)(2906002)(66946007)(316002)(921011)(66556008)(110136005)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9+6ixCgkCAMKmwaUXm56kB/3PNc+lkCarP07aMD+RvgmGi26724B2RHR+jfKXFt99FFZBAOsXTKr6+8YokVpvnVKDk1TECoQAwLqkZhKg35W2x2Q5Byg4rF3w2maPIyfRi99oT6B1AIACCDm8VNavbPfTgrUI41ei4RJ+wT5r9yRuKTN0JXgCx4TB2Laf9N7xhWx3oq1JPygUZyThnqLd5F3BqGIi+WF4U2ZNNdpDu2bdxHWsdIEhVPjlJrljXTpHDg9D+7pIpuP6PcRlcREQpbP/o27slBAKlC3WlrQel4x3cUErdd/YLeN7PGGoP4iQm8YZw67ggfc72Rsv2FsgMll+V2WAgNKzgGzNxsmT5UB7XxW2Wi3voyDnGCD/mYwBgV2dkduMfTqfknKp/AYEAdnW/k7w9iKZd15phVemAmxdaPL+oexZDGfd28z2q3xHULiAHs9vHm9XUzNICoAV6PabCTHswJmEQOJu3lHI2sCMfwOdEExurIzrMxLiJbKX4BjXOk7KvQTJQF2iO/eOqOymH3BqgietxgKZGf8Kgq0MGEp0a38xgtEaG/Qpm/a0nvqAqqjSHJOt1N9gcAeN3xlDShx1JrWNQsXJVQ1GXfe+3S63aR1eAHG0KtDBT5miG3R1IDmZK6gD8fBzk+aMo9jfa6a6uCGEFADVWIwiv0hn8H+tPyMOdF4NXa/2FcGq+eV6jgfub2FKnZ9G4nHToVXl9FBhGHAysEaNyZwKpQsOXuqJhQgB4LR4t2N8PZhoLL8nCxCgZCiOdLPMV8lURMdQxaJRry1ATKmVQ5e0cDU0t7v3c4Lj39A8kFIRUuKavDg/wrBzb1/0+BIdJTfqEby7yoEEddkZWQM4wjHZRthhlgw8lWfPkggDEvqbUFLjNJR8ZNyS7Wpuf1KzS0eTaKK3mRXMiC31SRKKD/RM+PGh4WgPbbGJ4fkKD+zbMwrVPDkwV3N4a4aq6vsm8yq2JRTylb/178U0pSh2ECeA0+e48JoqUoVx2U9OiP5aJQJo79K8FdpsZGrmbY7etga90pGHZSA28m9P5u67y36JK58Y0gz4xrplnIw88OZSdt2yDNd1Yiw97gIg7zeGTVvFA9+6d3iXyxbqqEQbiNEGEcHFIfpR05+z5r5xRgbI5o/lDTt73Mx9WWRzp2OL/7AEXfhNze5eQ+Bw7IdO/nPxE52g2MWuTvG9j1Rkf7Y4/9jI4RmjTGYubi4ENlnH5XMyaH/aI9XDiEJ6EKpKeW+cucJMwabF3X+SfpNUScXbSM9nV3n22+xeJIsg++LG6ZEuK6wt3U5EzUmUd6rZeO4iNiaWDP5hWZStAQqJaJmQ7Kn/ZPlOhWsfx9jo6YWHwvgRoo/RsPbo6t28V19atNtVpuwUoz5IMjVozc7993MkEB51EwzgVwTu47BOrj+anPbguXWNmA3D8mPBsv3w3/2hrawgLUhDP0DvWhBydSwZmfHJci6Vj4r+4iVU2LEIMP8H62de21K3X82FqoxuNrMWVvr3Tm/WmCQ2/EyL1urGLySITbwHjQ9Xa5rqzAYfHvpFAP9Ue2VZSBGl3LrisBMqRDfw0HdumWUNJLUzeLIMS4pKxPtW9LIKUSxdPMV3g+VlsrylUnE2D5lbU9yjH2xh2w= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b3bbee5-d5a8-4567-2962-08dc2064fe56 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:55:31.6790 (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: dodn5/r0YcuPYr51l8Q3GYSgIlnREzm3jfvXi7YYfy/C5GZaLDVyU5UhW9Pe61dNHtx4yw9U6mdBDSIpYWL/WArPoYnBckOIJLQZipVENPzD8acNnU4bVYQpngYfisME X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYAPR01MB5996 Message-ID-Hash: WDJP5RDTNDAZCSCACFTWOTL6K5UBNRBQ X-Message-ID-Hash: WDJP5RDTNDAZCSCACFTWOTL6K5UBNRBQ X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Current test-component.c is using for_each_endpoint_of_node() for parsing, but it should use "port" base loop instead of "endpoint", because properties are "port" base instead of "endpoint". Signed-off-by: Kuninori Morimoto --- sound/soc/generic/test-component.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/generic/test-component.c b/sound/soc/generic/test-component.c index e4967540a2e1..4bc83f141fa2 100644 --- a/sound/soc/generic/test-component.c +++ b/sound/soc/generic/test-component.c @@ -600,7 +600,7 @@ static int test_driver_probe(struct platform_device *pdev) } i = 0; - for_each_endpoint_of_node(node, ep) { + for_each_port_of_node(node, ep) { snprintf(dname[i].name, TEST_NAME_LEN, "%s.%d", node->name, i); ddriv[i].name = dname[i].name; From patchwork Mon Jan 29 00:55:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767515 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 6BC4EC47DA9 for ; Mon, 29 Jan 2024 00:58:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5E23A83E; Mon, 29 Jan 2024 01:58:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5E23A83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489903; bh=5VAs1KQTNTzCnb3g7QL1QAT/oL29+yJC87qcISM0iWg=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uwWj9Ux6qv+RZVDXZVnWJ3hGBIvQex5Eomp/+AftccLV6VdYmrgR9kD6D9SvFDb3h fEmoDD00iNnfHmuBw8DxKV/PXG4nU1Pa8jd+TzU9iwNUj7ABc0zswLQ4yM7+5IP4hg FyXDPe3HbSJ5pJ0VIaVew8HmxxVwunyo9foZ7xdo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 46A9EF80624; Mon, 29 Jan 2024 01:56:26 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6A85EF8062D; Mon, 29 Jan 2024 01:56:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16F0DF8060C; Mon, 29 Jan 2024 01:56:23 +0100 (CET) Received: from outbound.mail.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2E91FF805B2 for ; Mon, 29 Jan 2024 01:55:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2E91FF805B2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Z0sfHBDl ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ciNOfKRuKuKAnbnKT2n8KoJ7insCDhZiwJm4txWkC9MEVh0dn2pHam8trgs9BPExxC4zhp7X94T5tDPJtiuN3wAdhcacO/S2R3TP7+OOAlxDHlLVyyOQmd1+t8d/F2l3epSS+HXCVzlJbS6yCrDogc/KUd+iq0tSeqAxSKP+CM/EbeqjR2mFm20CWXQ6Fp/C8K8DfQVn2hemAHztG/TZhTno24fnIFEQ5nMrfiTzctG+EPlasBbs4ud+/74gddnwCuk+Nq9lRseHNV9aSEgeNq0QcOI9eYe65+FF+heCfLBVU18QPKxxNqiGYM09m+VAv+ftZDxH3EoAfePDeVKTyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VkQMqMHNzGBNFV13iuUeVRTw/iMGfmTezXaXKaO5b0M=; b=V+CaZ3lS8yuQjX9lV5tBV+lzPpDPd79ezHnOzmsXUoMoPNulm2chRFxTBFaVwrYgEVJOPlbjLrC4r63QLZ/loWeqerMYxwVXW/Om2Z70o5LRxupDtsAp+FfRNRyEumhVans/v0jHGHj4PtAww0u51JrFlNQLxzITMrf4vPhIzoLmGhHShxgm30FyX+VewL4hPEmUuaY5A0nvd0sGnhPGB+iONdGrEz56GyO5yFAn1rDq5W5Hi4PZvBfOh07Ggn6kywFDtBoBymxgo/KVPz3BIFmy3zzSxu4hVIXJSB1N0+rfSOys4j9tbefGi2DB/HrQUVcWVWo+pY7qqybZ5a4crw== 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=VkQMqMHNzGBNFV13iuUeVRTw/iMGfmTezXaXKaO5b0M=; b=Z0sfHBDlHpiAuJN+9qoxWMG02sESVx3jQjFwik4pTzX4uiGDR8t8xrIg5CreutPyYQsuwWiBQZ1mooEG2Ok8WpzRt3WlnQDRzyf6fyc0hKuv1Pq6Aj5rg6AqK53HxI4BJs3yHuLvO7aANPEjGLP1Wz4tojxLh0wpM7MLGnbr+1w= 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 OS3PR01MB9881.jpnprd01.prod.outlook.com (2603:1096:604:1e8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:55:40 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:55:40 +0000 Message-ID: <87zfwpj6ur.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 11/13] fbdev: omapfb: use of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:55:40 +0000 X-ClientProxiedBy: TYCP301CA0041.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::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_|OS3PR01MB9881:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bb41083-3608-4840-bbbd-08dc206503a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GfbepQvUFeMHclDTSIxFmtz4yQJVDrpVsaO7a/Pmw1qx5r71ohzXCDOwZA4ColP50OcQBwe9GBrPKgGBgHtpRUPOrwxSu5F6NdmU4zQhmvtX6fKsnU1VgToXsLfPbwGBc3/TB+DhYg9iv/xAHvTuv2zWKfE5kIE9z0RPwmPW4XO31JrRBZD1ujNbqiV43OpDUplmCPY9ts1J+W3+IDj7HadRUXEb6Ltoafx/DDVnWXc+2V9BF8vBfpIrNQY1LcphQGlkVshaKKzHL9wdQmehkF3xbiD/NtDP9/CkcxXH5Gw6h6HC0Gk1nuFegMJYiA+KyIOkkUyX3m/pS3pdC+4cej1XLyYM5l8/p5haJ3PaBFdHSm2ioyWl7BKmSOfh0CQ47vrLVIxwYoORj61X9FGEWIg6N9EhdvzkG3QM05rRpzEGEwiBA1g3Jg1GlIg9q1AEE4jakmiIJmcgF6siUhb8O3xggrgHK+kVW3A2+r0Z+OI/A7LZyxXTr9IaPLIuyAwqGdg+aAKIz5AW8Z8HtHJspThVadGkHcuf9IlbH+YuK+hRNJqbUrjIFYqXgebqsvcOXnL83syziBE7JJYjP9qfK+4gVhtqU7j/xWaxbX12Plvjjg16hGq1sTwPU76v4Nad X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(366004)(396003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(66556008)(8936002)(8676002)(4326008)(2906002)(7416002)(5660300002)(86362001)(110136005)(66946007)(66476007)(316002)(38350700005)(36756003)(38100700002)(52116002)(6506007)(6512007)(478600001)(6486002)(83380400001)(26005)(2616005)(41300700001)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wOEXD6nsiBVIFRHg03KcVoPw/B8Z1ASJLWzggrinmpcUuA+IUpGDXyCq0bp0c446lZrNxCAkXZV1M6yoC7BTuNbV74P2RYFfiEsF4koQMxDTBT7eGMtjCyqN8H/mTAYVMYtSjuTwTEnaZ4WIzGJ5PTuK3VhvToLoyNvNJ/2YePPxK4Mu90Mx5Xab3snsmUAjd1joH+F0TwEXUTSyf8KrL9zYWUs2vG/jNOHnnzHgRgNhTeweEyqIfwmsHuJW+JMfwGjJlpDghhvNHOozirVUu3Nn/6LOCIWWW8kTCcpkMlKNY4ys4kD+24zQThy8+uoQU4RcVooqMBv9i1i+z+7NyKoILxQ0FruvwVJsB4Lrv8c++kWfhWOpcL3f1cMqakwdqtVYEpnhISLMvsA5ee2Shdc79WtPDya0b/8OOHjE7dcdQqn44LqdcOcpAbIrq4+P43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vHFl4Bxz8nU6Lj6Uscym5KeiMMvcWSt4D8mUJ3fv+b7K0dZU3H563/B2rAvGnu2zrzOqmXDJ43CG8v9MWelpGgH2SMOGwXMi8o6O0msGhFcH/UWPO7waFjM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bb41083-3608-4840-bbbd-08dc206503a4 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:55:40.5777 (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: X7wjZT301/s67SFJTrRDfkkuGspy3a1i3QDDRBpHNnF7hfqmDJ31oCPc1NlNLAw/utvlyXBPKjxpOZRj04A+FZCMbZzYklfv5j8DeyZXgN2f6cJq2uBm1ZxuErL5z+Cq X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9881 Message-ID-Hash: DMCNL2VZUW3QVLACNQR7IBWJP6X7Q2TX X-Message-ID-Hash: DMCNL2VZUW3QVLACNQR7IBWJP6X7Q2TX X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Now we can use of_graph_get_next_port() for port parsing. Use it on omapfb. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 48 +------------------ drivers/video/fbdev/omap2/omapfb/dss/dss.c | 9 ++-- include/video/omapfb_dss.h | 4 -- 3 files changed, 6 insertions(+), 55 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index fe6c72d03216..321ae18f2747 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -15,52 +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) @@ -122,7 +76,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent) { struct device_node *port, *ep; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return NULL; 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/include/video/omapfb_dss.h b/include/video/omapfb_dss.h index e8eaac2cb7b8..426d12881132 100644 --- a/include/video/omapfb_dss.h +++ b/include/video/omapfb_dss.h @@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev) return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE; } -struct device_node * -omapdss_of_get_next_port(const struct device_node *parent, - struct device_node *prev); - struct device_node * omapdss_of_get_next_endpoint(const struct device_node *parent, struct device_node *prev); From patchwork Mon Jan 29 00:55:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767514 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 BF2B9C47258 for ; Mon, 29 Jan 2024 00:59:01 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D9FE3828; Mon, 29 Jan 2024 01:58:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D9FE3828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489939; bh=L97gldjhPAaN74NzEXmSjFMqwLTTfTDhmO8pJ+flifo=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ZW2FEmI/c4OwCMM+/1FxSDhpwTs/whB2UBWS8hCrkzUIv/JTjofWF6Z691dN9OJgH zZSrvpaYMDAGjK3yebH+aNV6O1lfseL94OLvn6skesJDkm/XBJjovSRtzSgHl0uehm C1ZO3E6Nhx5lW1/LMWc0oKMwSWLf6OHsKFoSga6c= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 218D6F806D4; Mon, 29 Jan 2024 01:56:54 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 41688F806D9; Mon, 29 Jan 2024 01:56:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61553F805A9; Mon, 29 Jan 2024 01:56:48 +0100 (CET) Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on20701.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::701]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 41E27F805EB for ; Mon, 29 Jan 2024 01:55:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 41E27F805EB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=I5VUEv4l ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JXKEdCM7UOA5BQfdWdcgrAXDsk/s1VZOrVj4/nGMPnI8YsZ1VsuLDWtXBOjCPXy326QcPOieNhbsASH8QkaguU/7yEIjS9WgCj4bPEcT8S+OL927tZ/LkdIFkauvIbyzpSRrToWCACawSxizQdNDcAfxrVLTc8Lt+IovvJctp7NPYogIPZL1MvXJqR0WVKpm0ArLB5afLwkXAcacTJlr5fyw400f2tknYyEbDW+uOLS8VsnGV3vW95YG8BI6LmXSygP7KPA9ly315hJBew6tqeG0JjoF9caLCSIZ4wSkx4OClbTKdd+FXOQq+ojU8/x7KHk9uO2e2eZ7T5thXBvIlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6IHKBzeEcUZQfmcDU6NiPxc3v8a75Rb9dHE1d6hECT0=; b=HdM4PjSXuCRfP9O8Yx9i8c410XHrUDnIDOhotzIr/km8M1xl6Tk3vlMdSmEulXgoBBkMms1vftUMyH1aXI3jP9LszOOGJVuvC+xXt+iySjlkN2KfkyD3xWmQJ0DUlq+1tVnhXhH1Md2F+q1OXMenxFN0iDHcV6Sar1oIDZlsW7XDV/YsDys77C/UpuiSz8sNE7LUip6OTb/MZvXOko6pf7N2X8eZ2OKjHbUSS/LDvxx/VW7U/5HFLgDW92mK1gUXAnIKYusebg/6Y5wXxPFYzshuB/P8qIDCN/fE926U3lIlyShkell+5n4ePxXxc9jpOLAMBn9VnLgoYYhPpEGTQw== 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=6IHKBzeEcUZQfmcDU6NiPxc3v8a75Rb9dHE1d6hECT0=; b=I5VUEv4lObV4bltx1OIzwDMo/bF2wl9VbMXUs3tS6NqN4pp9SoZUTiJNPvgiWYxteELEwHVX95GA4907Uk22TURXcTcV/d9SWedom5lca3hiiVqPjGnj6ndsfho/HxgnBOcKVTItM/s4qRhPWe000gX4FBezXe34Re1SOj7Way8= 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 OS3PR01MB9881.jpnprd01.prod.outlook.com (2603:1096:604:1e8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:55:54 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:55:54 +0000 Message-ID: <87wmrtj6ue.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 13/13] fbdev: omapfb: use of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , 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 Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:55:53 +0000 X-ClientProxiedBy: TYCP286CA0325.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9881:EE_ X-MS-Office365-Filtering-Correlation-Id: 148a8932-cced-4b6c-08a9-08dc20650baa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n6pRXDYEYib9VjoEnibu12yFAVc5LtclP2re0z7Mcm8oLYk7KkB5vYss+JxK48YAGjRfe/qsR9aiT16P74BDOdFMyRJ4mtzpDtfhEqFkBF3J6utKA38XwIMogXsPYV7MQVWxGYbDu/aC+Z1KPKq2EfrhKFTMSFEFk8ylrJDfVlgxHwSOMtFicPXrwI6crcWVTh/QA4qVIvsrI+fJ3RLlupFed3KuUMUbAY9LdeMnDAvp5qSbh3PtAIj5AgoJpIhoMtoA/r1IaS4gPvmywVePT0qVRTeQ9+4RYwJdB6G74wzRqpM2jDnrhMqL5NUP5LUqRA6vit7lFgHzlMhTpOHEJFt62U14y5zPG6MrgTGGz+VS0ppjYkgUAmvI3QuUfoXL2M8umKqVS1zDGfeeillcOTUEpHxsMgCQ/RTg8gfJSKx0IJwhjjHRBjgiZMoVrv2fTiOnIRyIkFVamwlgJ3DTJrKX/qtGsHt9QfT36B9RzNMhe8cLZdiOaDlhp6kPK4P1Gozz3l+s3r6K0UQkQbgEPaP1x71VWkEqqFUMizRFlPyYVdBMTqsZh0D2L3K86A8TfXcyFUtMS9Xx6ybFnBa/oGgFXMwgCPWs+E6efzXramssgin9r+fXw+eGjxXXG9xn2CZuY7G7CSxNJcwFtOLi7XYbU8zdu4fh49YxJQb+jeA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(366004)(396003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(66556008)(8936002)(8676002)(4326008)(2906002)(7416002)(5660300002)(86362001)(110136005)(66946007)(66476007)(316002)(38350700005)(36756003)(38100700002)(52116002)(6506007)(6512007)(478600001)(6486002)(83380400001)(26005)(2616005)(41300700001)(921011)(21314003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kr+zOy+bLQ43kStVDcqp2oXs1OHP8kblVcDPfhRRI1zrUQgFIJBA4nX8S2xwTS1rqbcN51QP/tO8qsMRenUJvFpYFvBrPW6wtCft1kDjAaf66iW/kguX2YOVTfIspPGxnSO1xV27DXKp6BLR7Au3UdBcpHjG3mRv4ryTjoaPNR/vVSwcstoHaQ4pI3X2R6EIEVdHJNOTakj0DG5EazbR6W2MukAZ4TMp35AipGPUKWB26ip77WnG3cne5WK7clxekP/hMsTNp95UCEvrVPtL0SK8ll96rpwNhsOdC6HGxqmLpiNHN4wjBayCmOQpvrpHjXjMT/zSR4GUuxKxqThVClchFeHzXzVFF74VkUbaTwgKGje/3SSQWLhxqz49Ji6UksMGDXQteaewuVIiPez+QqMwtgK0z5iw1VSdm0iOceATwXSFV5cAa2K7SnPxMlRp1USiOyIwb6zz5ypaj7znA4khcPXbS2FKEqGfjKatAU2sE/6b74YfmwYGjVH+F09LRddEmmDiv70QUOGd+Z00uahkC4CKK98sV7Y57PMyE2s3cuaKaChn1LHx0fEUykFB6YrPyDh4S8OS5JA0eZv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-MS-Exchange-CrossTenant-Network-Message-Id: 148a8932-cced-4b6c-08a9-08dc20650baa X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:55:54.0436 (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: r2mIQIUXOZa4VjVjOCekXhrNdIv7lCvvBCD3fB4hIs0Rn6DpHJtZNwJH1CHbKdm4TxYLLSaqvxkVuAAQdGMeQi3B9YNsUAD19392rOJX08xGjeCVTZRdH/IoFXAMWPqx X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9881 Message-ID-Hash: MMYZ7XUELLXENY6O6AVNV7B7CNH2V7SR X-Message-ID-Hash: MMYZ7XUELLXENY6O6AVNV7B7CNH2V7SR X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: omapdss_of_get_first_endpoint() is same as of_graph_get_next_endpoint(xxx, NULL). Replcase it. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------ drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 3 ++- include/video/omapfb_dss.h | 3 --- 6 files changed, 9 insertions(+), 26 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index b7eb17a16ec4..50fdfb9e9411 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev) struct device_node *ep; struct omap_dsi_pin_config pin_cfg; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_next_endpoint(node, 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 8aa2bfc2825f..1cd3e7251964 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -51,24 +51,6 @@ u32 dss_of_port_get_port_number(struct device_node *port) return reg; } -struct device_node * -omapdss_of_get_first_endpoint(const struct device_node *parent) -{ - struct device_node *port, *ep; - - port = of_graph_get_next_port(parent, NULL); - - if (!port) - return NULL; - - ep = of_graph_get_next_endpoint_raw(port, NULL); - - of_node_put(port); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint); - struct omap_dss_device * omapdss_of_find_source_for_first_ep(struct device_node *node) { @@ -76,7 +58,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node) struct device_node *src_port; struct omap_dss_device *src; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_next_endpoint(node, NULL); if (!ep) return ERR_PTR(-EINVAL); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index f05b4e35a842..83f53858e5b5 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include