From patchwork Tue Jan 23 00:03:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 764979 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2103.outbound.protection.outlook.com [40.107.113.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D874F1FB2; Tue, 23 Jan 2024 00:03:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.103 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968234; cv=fail; b=GFCfhlAX1pVsS5isg6F0duRbjZlCYbNwS3eFza8XVIdfqj5FZ34oEtPKeSUYNfQxHb0prdrCOWQmKgK+uP9G4DK2j8rIgpw1aKAlDXw+XpTWakTjFwOJUoj4AMEAaOdMWdnwkJLnxMSruWpRlfUJbfKxNOksDdFiQJ8x6EFJ1U8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968234; c=relaxed/simple; bh=yvewR6pc93N3Y0GWnksPNQTrp0S2Ek0rP4C+OOW2ccA=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=D5swNdZ7BIMoIXrEolQV5KxYpUdNOKq/HE53EDRVpbnZy3zospcnUSsUaisQ6kKLcNGO8ne5FhlQRgFN9tcLpaUBRg0qIaQlQ2l8P+wtCVJiR52XiOl8BbaDg2UlrMcxfMj+eSNfDFj8/WVBw+o5rP35ba6gOJ34bnAbmJhyibE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=gPOYuFDT; arc=fail smtp.client-ip=40.107.113.103 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="gPOYuFDT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M/6oLH82UY47Jjo+8X0iOwBSv+khg4m8tLBK5mNJFoOdBx/EJiX2B72lEFxF4gjcu3dneIT1UnTBqCELbuRso5Ca2LF4kgq4YSESbHSneyLmba/jEkeC48j3TqIVqYXH3eIYDuN+zD4tCaLAptTbB1vohWn5Tlzt2EH5xAOtYM2bJdsXr0bje0u+Wng45lJzD3qWKyK0m0E10zZx06HgS8jg1k8ywTDRcHLbOgDszcORr2u8g4vRE59pu5hV1emPcGET1VywUIlUAaQr5xLBP56PKrONr+hkTYaOPojaMjoZt8gNY3uQ5FQrzD/AqDuTfHCQtWcxg9rUiU6b0dj5nQ== 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=Dq3Kh7/fGwIN5FvnAhyW7hP6ZAzzy5HChuvvWfKeNfkdR5Adq2FFp5BmdNd529uKjGrRH8/sElXrRDEZMnYPmazhCcxH5LPLb//ZNQkl3bFQT+JxI923RIQcKVxAFssXIN2esKQ73wf30x24fhJ5W2ejvwaNpVkl9xkWBnlbotF5ZjS2Klw77AU7mf/LpB6/BNMUUe3TSamLSAmV6BaFD6CMaycQGaZCBaiV2BzosO8ONv3WeDYV84XR5uJD8v6Q2Oqd4DhUuKuwlofWP/tUF8ByJZUMFIm32KKnqmYo6Ifyb0gymTphWm4sUse6rAgJeeekUahl19dVUYSzS6i13w== 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=gPOYuFDTvK4Mhpk5j0Br42P6rNRDlxsOAAmW5Xjzj39V0rO1P+5KEOLd3RyybDC2A9TO/bxi+yi92eM/rBhd5yDzM76AQ9zDeMJIF4kBAANr7UeP+74wz4kTnAEMt9AARKfIVSCHJvQQhFUX8lUOdQhPE4xj7V1yl3oe9p9SGtE= 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 TY1PR01MB10899.jpnprd01.prod.outlook.com (2603:1096:400:320::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.15; Tue, 23 Jan 2024 00:03:48 +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.7228.020; Tue, 23 Jan 2024 00:03:48 +0000 Message-ID: <87il3kud98.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 01/13] of: property: add port base loop User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:03:47 +0000 X-ClientProxiedBy: TYXPR01CA0066.jpnprd01.prod.outlook.com (2603:1096:403:a::36) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TY1PR01MB10899:EE_ X-MS-Office365-Filtering-Correlation-Id: 7442db6b-035c-432f-a802-08dc1ba6c5e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FhPNGpj/q3KyJx9/vyGJeTaZNDWSfXc5NnXZaXdpS2gYJnVHdwJ6Gj8nqSCgaQxWSEWxyfROvVSUyqYTOUZVf2gECMuwF1OiGjvB9PWNsrnHE3e/hYL/spXzzjc6OxLTpaw8sLwADrNFdK4NMRsvvXbrrmKxY5UV2frELlc5tDhORMdrrvGFF5RrHiSsJVdadMHw7YiNKVvtccGl3lXOCDn0X8+o3AeIbqFQ39yD+7WqTO7XItavDh5bdNxuaLiv586CcLC5KlAVfQa/g6z0M6/BO5KZD7IvYu/uJHhkqHTj30QzIQP7kP1H54ZNVguIFkpOzN/8q/WWfnWZ2m3+EwgeHQNhkcJNDYIqRA/94EF8/+fS+Z49DrhZEUD0aCPZ+GbmVfdaUvRtS+RRXeRHsmBR8SD5vAktDNHjnvkVGVUATwUXzUu+cAfSUSmjeKkdMF7xZM0I9GwUFnXIoNHlQf84ypcA4fLJYUGkZfBJ1MILhNp6std/f+I4svf1Z1QNatplJ1d2ep3w1ODx7Oap8WZOxuhfadxQl4+N/Vi5fWDgM6lbPXHWiEl+oHyaAcrYonTKVIpIqsJUF/AvYdyO8njWbOL3CxU4jMtLQNpCLCO+J/W3BZz8efCEZUz/viwEG3S6N3EeNRQRYVIod89xuw== 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)(366004)(346002)(136003)(39860400002)(396003)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(8936002)(52116002)(316002)(66946007)(8676002)(2616005)(6512007)(4326008)(110136005)(478600001)(6486002)(2906002)(6506007)(66476007)(41300700001)(7416002)(5660300002)(38100700002)(921011)(36756003)(66556008)(86362001)(38350700005)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JI8it9GyVIw16Z5K+/c6VvgoFRDMGeQwCIDiIq04J0aIJsQbX3U8kc+8q12g1leXawfAUvIK9I2ShmiTii3+dT5jYfDquaulxuYzED2AcqN4WAhN7JW/LHC0qmNrsqLKWL8PGoCfE/nAJfb2zdvYGS1Z9u/77rBQGmDHgDdfulpxyLVbsNsKiKcYvfTFC0YMW2XVzqFmqFLeAgiEs4TE1IH1vN2PWum4Zcos0VbPCj/n9xR8RtncHlWuz+nYMSKofyMooVXQESPjgmhJMSJap/LGd7w0J3VA6F1fd+z6c8Ttz3dF8yObFDgLHchCdS1xRUr/jdepkbgM6l23nw9yJnEw26ZjL7K3z7DCSqffL7uQ4IJ8FKezwkqUB2cEQOeU/wQHKHivMZNWuFUROefYlopJbY3RzMjWi9Byqm5mqjcm4M0KYLh9n0ZCUWNfzd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5v132e51KD/FgAaTTY0SKVbJDy+G5NceCfsydyM30SXn6+dwsn8j+N/j31f4hfbIOYYbtqb99QRumd3YJQl7ey5Js+wRL4s2RGrk+wuktpTFRYru38wKES6M= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7442db6b-035c-432f-a802-08dc1ba6c5e9 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:03:48.1160 (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: hznNz3yOS/m0rOV1vdeuEpVzJIyJZFBUs6dev1/yIoSO7eo+VHIsVZmMFZVf6pCo0vI+MM5Zodc+SXCRx2vFFYY0Z/RxnMb9yQKix+UA8cGaR/2MNTKuGeN+nzNduydx X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB10899 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 Tue Jan 23 00:04: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: 764978 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2094.outbound.protection.outlook.com [40.107.113.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B66F95243; Tue, 23 Jan 2024 00:04:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.94 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968247; cv=fail; b=TqptNwBiwSjFKxmqOrrmy1Qjm/OJp8vpgGrtuNft8+F8+k81/4sIFB9EShM9O7z6Ir0KznonAof2abNuo7Z2BjD87UocCb4TvEJllEAPzHLKxg3yVXn6HRqLYDPToC3fLM0A7NgHp8IBpMHIUhK4Ptc+HAIDBpza1DhqWlIqlCI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968247; c=relaxed/simple; bh=OvdRsSVEWjTzHOrFd8LI+hpavpreqh9zTlx2fciKJVo=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=XYddhlXGyAmWxqmjzliZEAT9HyOIDLwCRP+EBO2BpQXhT3LdQP/dZ+r6NrYyGrfOxFFBBgZxj4wmXwqgKJIYOSviIvS03eo92bBu9e+Q40eXrS1l9qp+QJiVIMzU22QKtQvGilDfSB7jhQ0Zw+SKsJAktABE6i8LyIMJ+uNDbL0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=dsd0i7my; arc=fail smtp.client-ip=40.107.113.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="dsd0i7my" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QUtsWflZySevDZ2Tr9rVjeI8fd7+qsnqaQx4wMmzgxHq9pSrjpit8tpj9sT/ayBGJWrwzsco5DP8esW77YZTdWX/5E9tA+wJt4794T33g1YqHPXzY2KBZnwxc3rFRgVyZmdVSP8wFPIOGqoCYht73sBXudJbURcAoMRqGLv9THUITR8YEyfsuFyQPZDMpdGu8O9iHOARvaQFyuaGykAWPdzQy4c+ZOCAM2LzfNGf0raxEWbN30yl2oRQwqPSMLx4JnZUi8x7K8V/EZCW4TlJCdy+PuWHc+eDsJbet9eRaQs1dhesiiYoOkkMU4kCGCa0HbznvC3EQ+0Rxgy4RjWV0g== 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=xv4bYvzdFJkNE2eLwLJ239oK10SoDUOyrVQoToNnyNE=; b=CWLwvMfv1D0zdT18EIRY1nEzG2g8QMA9eo0rqJIvOcHuvKTb8bRPXlp3Zv7wNLZ30poDGo8rTZ7oAkygyJU01qUIZMGOGK0Y304j4W+No4Ga2wxHoUBAMG2dwEQ9B9brQylj0gR2I2V8VRb5kwclgoUi9Hx3LTyL6vSaVvuJvi5wzcPINmGjCdnkM40EfKRbhs+YJ7f4SOd4HGy/RQIeQgL64LkPtop8jikUlEoD+Q4oXV0GHsxcMr3L/p6vq2vQRX6tMAusZHs8Ir5yVcp6v+FTNVDQaWsOxBbwk+Bhdi7FaYuP1SR/8g7fC6eGD9Z4eqB8CSDSDsjTzlF2ncgIOg== 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=xv4bYvzdFJkNE2eLwLJ239oK10SoDUOyrVQoToNnyNE=; b=dsd0i7myYhC+st7W/B0CPSBuDCQn3z+0C4g8pp7cP6uERJjlgIQCcLWgDpdwKYNsQEr68wwHVX+eFWYfJSGLa1Aaokl/DkSKZsl8SleujeRatjI7Q1TnfceTnvm30F3lSgVYMQgFr79xeJnSgbMor7LtYcUMl2CViWMC4LLqrIM= 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 TYCPR01MB5583.jpnprd01.prod.outlook.com (2603:1096:400:40::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.20; Tue, 23 Jan 2024 00:04:03 +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.7228.020; Tue, 23 Jan 2024 00:04:03 +0000 Message-ID: <87fryoud8t.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 03/13] of: property: add of_graph_get_next_endpoint_raw() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:04:02 +0000 X-ClientProxiedBy: TYCPR01CA0196.jpnprd01.prod.outlook.com (2603:1096:405:7a::20) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB5583:EE_ X-MS-Office365-Filtering-Correlation-Id: 95764876-599a-453c-4998-08dc1ba6ceec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a5QxWOxk8OYJQ+DdH2z7dGDX6UE0lTWHe5/qBGhmYlk7WFlOyoisOmpRsULRxVqrygP3LDEOOiIdpwY4K/N8rOaI4XiwRXuA9sNhLrBErYzV0/apNERely2/IU1vdJvyXc/RNnDPsLPNLPGJxTbR0hYwuy4nYEO7oeeD0Ei9WQI4t1cwtOHkDqrWVA3Acg1aDj69i+hOaIT6UDiufnNYKGokwXBl/NpJWFYz2ky/cgD+Setr1cYE2aQCe4buSypO760isSfOdhzpnZ5YZ+eU+wpZi9s6GzMpmNp0Vu2cQAsFXI3RXYP63PT+09erT3aVABsK2i5eI5VtET5MxdUXhK6n1uGXACiQ1xjPHOljb8g7Mnl1sAYzwAq4cYbaV/fEYw1Hf2ThmpjxwdFbN3teBRA39tIN/yYp/RCmZQk8IGePv/awx8zch8IskoJh34X/jkx635UTYg2JoAZzNbG2GWLIqECygKAC3U0mL2piXh9CtDojr0Tu5YVrHjs7IGVRTvOQJSsOpS3Avu3Z/c2LtOQAOUdGQxcPYQa/WbkYGndkr4JDKRKo7e8pYqxdiy+RPjXVnKjgdk/ig1MciI9PZvZ9tn9uQLn8/fh2Y8PbZWcbxOek8uE+1nN6Osm1/7AKYbSztFIZFKTuzmJf2sMD7qlFLWOqPzJor9Zd6skfwE8= 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)(346002)(136003)(376002)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(2616005)(6512007)(52116002)(26005)(36756003)(38100700002)(86362001)(921011)(38350700005)(41300700001)(83380400001)(5660300002)(7416002)(2906002)(478600001)(110136005)(4326008)(66476007)(6486002)(8936002)(8676002)(66556008)(316002)(66946007)(21314003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ofzf1KJDaPi9+PQBpBPKTXm4cy7aZ7yzQqrfpeClJRz65AmWLp4GtXU9qhhD/LVROUnaSvPJbnBXKfGHTvfzTGiT7wqx/Th+npQemQa16pU2lBvrr/EPxcQ6bActLdple+tQHZlpMHQ4o5YsOTUwbi/tJN874tGMFr/YYORVDJ2SGJx6hpAh9O5W0dkqrlLOITRQiU6Lxel7IAYYrGaltRs0E+goFZcQ8QtR5tQdRUD1w0YQTA8NQthdkukYvckTQ2pHtww0oSNjmvA7GcWnDwGN4IUI2jnAqEq51b119roJsBfvDmd3Ssx5l2xubtjTEWy/JwVJOGkYZV9GnLSHvgdJcGVHpkX/p17bVPHabKgnouTcAxsPJzZpGKzu8rQkzv3qxwU1RGJHNNvIeS+5cq1pmwX3Xwiy3UBObV1NkJJWqoJRPy7juF0AvBzj+gmY/Dbf1w94CcNhXAyNwJFlUtc7iWS8VhaPTdOYlTVFYYmzLRfDK64VBkShQz0fNVdek+hbsSoCqABytU69lm/pwUQIUfg3GnIpB6NLzqjcHsyiu9JVb7vmuL7LeCleDfjcRPxQVBr9HE3sVWxcAGbMIZXUPejE26rT070U+E/FFJ8H421YNcKQ8yoCg861kl7vHZbQ4mkUSwahgnZVn9ONknVgKebJbgbNyyVdmHqA3FzxGLcwjVxgkP1Ku7Ur+W9kwiqFQwujcPutGpp3LEc8QTTOg3s0qDmQAxoYS7p/R0+wYgnIrviePEtXrSLoiTHCzEHQlCe2ncDs+56NBUC4VLUJ5ps2DruX04i1ATiTaDXkohrGW1xZm4ejFTHQ9YIO39x5XvHSC1dWDf8BI05edX7AI92KSJKBCyax2/Q7dEp+lxfroJLY8zyvPm08jKLSsiqigkKjwuuaISX39au1PSeMyZtRpbqS/2m4QUXYcwulZIXQn7/MAtv5S3Jijy74jTuTxyepxgOQitXHC6nN4QihbVTP+ZoE9ZgevHJVn15Ktzrf1XBmtIwO1qSU5t1NucZEURBFX8MzwsUH79ItRyb22t8UxaB7Wvh3O81C3+Ofk0qXTk0rH6ShpTdY6hc5T3fJx8Go5SqeLmI6asV/wPparsM4XvHMEB0oednMad1AKiIIVol40Y/gBZHHcB7qdPill6UzBp+h6idErKVfBptdg5G4VWvXmxKTdf1FbkkVcTFZEnXMQNnL5+icK6s98xo1jaPxnJ44VYcEwXsWPx4KejmmddMxu0m0clRwXgiNrlg+DYA2p4oaTgQNs7USROtmzM4q4BxYQr5fPGF2+vzEUxCeizVx2L0hY+zNZkaJpnYAvNHbkOkwPXO23qr83XFvPXmWd9HsyXTqjJzbx0R9DJiLaTusxaNti/eLdXjzd6vlWcEyY0Lv7QkV5wEX5TiFwdnYQj3iqTmNfre/lwe8/G6HZRDtXgxY+wHsB1aAx5rO5T+6iECiHKqCbp8BbzpXBc0JyKsvk30w4GB3U3ttjT9pzLv3z14EoPC0Y6hQbAu1U5Ah7juXk7hZ/YGPUw8tu4e8GdujH5PEtB+c89efFkN3Q42ALvRqQBKJVNA5vjMQ+YcP4TpfitYMETtFb6V2Vbbjf4JGLF4PcP1DO4SuyDBPSEZSG2Rz41ffIa8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95764876-599a-453c-4998-08dc1ba6ceec X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:04:03.0927 (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: D/gDVMILAYMwsThzuxyK0RTIJN8bF3Lr53cCIFL36B7bLEWbWAqkAHDlzQCU11C2nKWd82CfIYGP5CE1gMl4NFc1z+qA3BJUE6xK4I1XmKmNBLFGvQWgbGMpnyhnlQSG X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB5583 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..e2d179cf7d26 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 + * @parent: 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 Tue Jan 23 00:04: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: 764977 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2109.outbound.protection.outlook.com [40.107.113.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 975E7EEB9; Tue, 23 Jan 2024 00:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.109 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968263; cv=fail; b=QLez4mk2QSFQVPqJx5U1aqBHOOn1cLRV54lbYGYT3JD/C4AzQXrfeABK0iULEOU6paWyFRkrN/mav+gujxuKky84TVqPVbNnWzCnMCatHT7SfpUqu3drRfKh6iYOQGvKkVUjmxKmq+ClM4P80FAT3M1xBBTWhOAMAZnJWdScv5o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968263; c=relaxed/simple; bh=ffS14aV1Ln+TfLGSo/g586z4rf34Vf14zbKTRPb7wEg=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=NvCQ4+EyrsBDQuAeW1kpf48+vnQkPXE7V55ZQxpJNmD7W9EfoohwmA+oHPRNliTZN7N9qgiSAi6FNqZl52So7Zb0nZ2F+VtCeweb7zYv9Q5PDANsymQogPUzebMFPKqLL5kNPnZXDsyNeuIr0ra4s2/SZBC7QZq/AE50I/Sisl8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=ZAk/VbYW; arc=fail smtp.client-ip=40.107.113.109 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="ZAk/VbYW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TLv4Y1sL0aNB0LIDDakcNIHTwT3sFK4CyQ0gA9fdqkyATsAxl8ki0GxPOrSbQZL7nFOJOdvsuXOysL2JMdZhC0IsNhvRZQ04TLS579H4+Ca4GhLUET6D43JwCP/2u+BvHXuGQfJey5jP3nALPD8zjUb5iSYrd8HUVytQeBzpNJHm//SIrun9NC7Ny5u+xOZ3opsFQRkRHqTWDebCP0BaoVqY3BwsW11XdNAV4hbAu4ISWVpTDxNpfFL9F9+96uCYqGqQoy9xgYBG7fCScwhPfJbKZx2CYtX9N41XF9Ki1NnkY3VhqpUdna3cLAZb6atk54ZopP3Xu6A6cqFw96l8Wg== 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=USRsXq1IKe7v047MgzWkjciNwH94rAehYC3JR0w8HFzp7MQUwoqBNT2ouHtxqEDsl4DXk5ggP8EtI7AeINFuryzEOj73xMrOtOQsb6YA7gKC0FmZ6R+AyLh4ZdMk6AEpzSSgRmVXqIVWjBzIvBFb5p0s4P9tWyCaZjrAqVpH9ozZJXxjf+bAjuDvEQj6idEWuEtOtyjLQWruvkV2z+zSh7OLcPFIQN5CVfhQVboyQJ/tkQqoccG0mB1L8K0zoZMXQeVHBgyLUK4ZQHQTw5cxRAtNdGbWMVbSJdAVz8NGpegsN/cxH+Lin0G5FD2KSjG7gQEKBUbrCpKM00GNeU81/Q== 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=ZAk/VbYWPdkN4O47A0/XoLMC4P5Bg7N7l3gi0+2OXID8G2pp8drwcvaRMhl6eB//He59RxVcqHVUf2dh1gRPt656bF8yWFXwocAWkNtslVcqe6GoVW2Mdhs6qB1DUh0ikK7qmiDNcjnRMY43YWSuTgK/oGY0uqaGbJbcLlIUX18= 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 TYCPR01MB5583.jpnprd01.prod.outlook.com (2603:1096:400:40::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.20; Tue, 23 Jan 2024 00:04:19 +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.7228.020; Tue, 23 Jan 2024 00:04:19 +0000 Message-ID: <87cytsud8d.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 05/13] media: xilinx-tpg: use of_graph_get_next_endpoint_raw() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:04:18 +0000 X-ClientProxiedBy: TYWPR01CA0037.jpnprd01.prod.outlook.com (2603:1096:400:17f::6) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB5583:EE_ X-MS-Office365-Filtering-Correlation-Id: c6454cd0-13dd-41b4-04d3-08dc1ba6d87e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C9eKte8c5bqvP/Be6seKClBHLOY/xdCQhslMdiVAWMWMwCcJYnU0GBOdaCbDiCfy2AKJKiXlPvErZal0HHYqlpJVpNCxPOj9mjcNeLmVXHOSX48Rmi5r6jROUP28TsbOJGxBJnVPw+zhadbsooVVtDeCp9VDUCeTrmkjgbs2kXZgOAv+kOQFSEnXGtU288LI2swCzyglr2h2BVUiC0/LNT8DKzJCx+Rbch0ntKSRiXTXUMyx3FlCvA0yuY/JOJP1kb7WZ4RMo1awBOyzIMoFPP0nH46zOMwv0V+WmnZvUkVBkaz58G2qWSZYDkOCqdF6L4PpeafCiS0j8k4N+KZ7LoJ3SMUP2kgy/bMOjTRAgRkX1LaV2i8K0lEKy0YUq0HSWDVD5mafc0sSYzltO4rfZV1RmZBc3Wi0oVDw1EumJnV0spQRcIOrX20IOxNWEFbxK1ia860H6AlNtgwy4VZwMBOukBnnijhdQLh0dPQZrUtkw3irc9b58fEQrFICLEWIUhkuInESDLDtXUFoflPpnsMLjbhcKvmbRXtCzQBk7i3ctE+7/HozOwivwYbfNeC4UhBSIHxPoZ8D7KlAMCOjuk8IrLgooVlbHVTwwG1bG6SwDSdnwg2R0ZNGS3wz67qB 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)(346002)(136003)(376002)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(2616005)(6512007)(52116002)(26005)(36756003)(38100700002)(86362001)(921011)(38350700005)(41300700001)(83380400001)(5660300002)(4744005)(7416002)(2906002)(478600001)(110136005)(4326008)(66476007)(6486002)(8936002)(8676002)(66556008)(316002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2Z1HJCW6/9/4FxCpbeg0l/NJ2qOtGnd14ArlNBz0dHtIWNgcSIIN+x7om5XCLD7RjPVfwu2s30nNCfpBLsNqeFbX4fDc3VecH5y/TORh1ASE3TE6oybRfMe7hKWmv3i9hMBUxxF0Hs9daphH4A68AdrajrUqBjyJxp75rhxuKJ9NQRxhbxPCSTAqan5cl8toQlVnrD32Y4lz5qAjrhJU3chYji5LBytCufHFK8ObP/HIwRZMySUwfz8ma+NEJ+9+w6XBMJ+xfHV95IZM9ey5LQYDdTrDGkyNVy5Hk1ddylpYHe2PtP/ZA5DyVdUbOUmEKAj2Be6a5QN2hAlGvGl5Ibavlr675oEdEDmKh0UiANtHBJ9nNPacBs+6bLwb/ofGL8UpejSNEtPFGUh4cfjsstw3EA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Z+eUxYStp4vyuz7RZ8vYKsS29X3DFekgZIzrE5LWDrferSQcUODhAkyqrzs/YL4Af1gKxE6TgKmYL9pd4s69xE3pZ/eM6SaqaJe99uWqhZJLImhpywIh8le3+Lp1Y3XEjIDvrsalCDSz4bXJgssxqgxtiT4NfE7Jwa36ovIeDk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6454cd0-13dd-41b4-04d3-08dc1ba6d87e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:04:19.1473 (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: u7HVhQpsfFIyASFNggCqA7uQ+D2pY/gLz0T3DInsUn7qYJZmsPBlcxQ/+5rsKS8YnXZxQnYNvbUwk7MKYL93UFB5hmqGtGlsJRmH7YAKSlinC8S8iCJjEFMfRkvQlXEG X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB5583 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 Tue Jan 23 00:04:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 764976 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2099.outbound.protection.outlook.com [40.107.113.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12C493C29; Tue, 23 Jan 2024 00:04:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.99 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968279; cv=fail; b=HUpZzfi7wAn2Z49XmcgsdWO55blq8QNtT74RDYzo0b/XteVAGZKWoc1P9s0rERJLYBA150oGCbckmcPGFQ+7QG/YuQWPs3GRPMTcluG+NODFrA5jDc6FNK2U4UnDtSp69/zYaReO4TnanvCewFm8YbUMcmpjFazhkPOYeu3790k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968279; c=relaxed/simple; bh=tynbqH5KYpLUg6XYTK9TNh3jy6TatTHv8KxXvkIsYI8=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=q9MDsuNMRVzTuqYXnVhXe1XvN340720HBWX5RdJ7wmLH33td7ZDLF7vD3owkcqhy9aLUMJlECQpQfnTmgR1cplc+8NWYeVfPTcWojEaQUkMQoPyWigjLeI/csnHsnPEeg42/x/tamqTwyANxFsUMwYGKRzPB+pbjpvY6O+xG4V8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=gw2xyP3J; arc=fail smtp.client-ip=40.107.113.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="gw2xyP3J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B38zfUJODslL2RkWKfwoFjkgRp+zxjwsFuLEZSg15bdd4EkERlFKE1cMyuGqGMolqE9eN7YXefIcl5SkExu6iSbHfkP+rUM8bM/OyDheCPXpIVLQ1ro91j/QlZv2iK/WFS9oN65KxJEXqv9Ii9vW7+ZzRHiG1wDa3UeXe2AFTWQ6YaoHrFGE87iWbS26i218jQJVlAnKd3EMV9D6onUw+VODTnVSs3lzqdmnNQmMNzW4KbeAwClBDQrmD+DmvdKLj52XWbiTGKsNMHbi7njQAQ/wPjAEhcRTDn9/8c6jO7UajgWM/Bt4spao6aWXDW3PXpUfjzOB/UuazHBwvOw/Iw== 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=KFdrzG2Nu7mSitTmh1tMYbdM8kDV9SrZ5M6qlRectP19OODcsRa3Y6LFXXbMW95XkHYz9T98+/l4nWYJwtfCg8XDbOqaEz+ey/FWFjGJBEhJXhKyg12q0O94Xe9zn+LEOwp1Q5N+nF+KQs8NQLbzcRh7YxHgUKz7iLmpByinSyuGdLsTtajyADdBb5vQX4INy+ZT1QE0fW8fpTmW4qnPWLc15ozC0IMwGtAxm+yb1CPK5wnnGPBS6jDHGHei5oF/I/hE0SpdIhL1NlWEOsSJVmfUeVrZQmO8wm9Dcu5o3SAvDuTpR/9M7b486fi0/FbtPvmEGRe6S8u+DGjCww88jw== 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=gw2xyP3JrwRC+2syp6z1UFm9Gx3wrX/NvZZTHlhx8dO6Dd3hWoRDjsdWclPmBsLSytdPhl9/scYene26nYlrNBVR0sRyjc2blpiU7bBzMchTTBaaCXj1/6P8qs7FBPRxdkMmEomfCdxUXpb9ijZi+swDZU7HfLPz535c+8s2OKY= 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 TYCPR01MB5583.jpnprd01.prod.outlook.com (2603:1096:400:40::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.20; Tue, 23 Jan 2024 00:04:34 +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.7228.020; Tue, 23 Jan 2024 00:04:33 +0000 Message-ID: <87a5owud7z.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 07/13] ASoC: audio-graph-card2: use of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:04:32 +0000 X-ClientProxiedBy: TYCP286CA0139.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB5583:EE_ X-MS-Office365-Filtering-Correlation-Id: 9cbdae83-6548-425f-170e-08dc1ba6e0cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DacMYK2p2ve2d1Cur6hh9YOzriZFwPztcK+SF25Hpwgm8iP+u61GBeD6HxYFxKuzbrT6fY1LtCkxfTdF+OZsjZQnBxGnJJubPUWwjtWgbeXarYVn8cXb1mBsGDJdUFlP88Qdw4IApyoMtQNR/gpu9a+QYTEbFHzflyCGQQg61BWl3NDRXUiPH8pwpoQ1M2kygO91MtA2xUPSPsDGNDlpAIzoEVvKvzZpQtR/9aqYlEV4wX8sfHNAuzzye511WUQZv7SvcwuPKdWn38rQRry3w9LYxeocxL3qXz9CJ3tYb+msL9zCBYGRtl04Gkgzr8oUrd8cKJZYhg315BILG28oh6Ct6xl1t0MFj8nCBZmLJHAbCykyFxYi7S+03tmoxxU62HF5p44YjLDntvXbGKnCwgQWvNbU0USmA5M9afp/A1ZoS3ssF99KOY1NuMMdaz+2KK1hNKZh7bAoiZqeabZ80xuAsa+Hc7H67zwguCCNedp/lBZmuaYucgDJ5pHf8X9VcCITLF0BEPo8E9uj3U9sPNzDSBgzXewH5eTcnvAEtDdTQDIzV2li1/d5z0amT7H09QUGiEwN2SJqo+2CqYbQEMBQEJaJ1PZwP9Smw4oxPW4qgdGlqYNnhb1DIZMNJPY809YVsO0PrhnKMur+YN4hiKbAdkxQmYAKv0+iavRNt4Y= 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)(346002)(136003)(376002)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(2616005)(6512007)(52116002)(26005)(2013699003)(36756003)(38100700002)(86362001)(921011)(38350700005)(41300700001)(83380400001)(5660300002)(7416002)(2906002)(478600001)(110136005)(4326008)(66476007)(6486002)(8936002)(8676002)(66556008)(316002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gq6WBlFwn0xS9keYnnexpSMPaF2AIToPxGiF6IGW4x1NwmkAtNWc2Ac2H4ZqLNs1lZvsCwx6t662iTDTPCHcCQk6ucITC7tV8QG3QywXQHLMw/PoFWiBGLZRy4ELjh33T2tdOfk82h2/ZxrnpxdxYtSnJ+9fo2Qr6shvsRzNgspjN2+vzUlNwGIEV6SdrP6PnjsDV4UMvmvmnnmq1S0OEO3HorekuqB/jDlNoWGe36sjJi/OaaRR/8RTxNRJhkh3EAErh6tmpsAbUHfgXkAlT/flpWNUNEPljPN+ssz1Vlmup+wx7/THI3XhuFHHnHUsAGyv20N3XoMf7JyrGMQJ/haEW7pbz9QqAmUqFISG0+7tgOuskchW3oh95CKTQSya8/YRilrTCjOvFMcX3A9Mjg5fzs6BCXIS9Tf3M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ZmB7Ue2Q4MM7QUeAqv3oNS728sVvQm7qbo4qKPxtBXFyFHpySAeDIB5MdPshMEgaU9zNtLCzIMcWXsqLF45TyOHHBIQF0kqzesO0gKuypb3oONXvb2zH1kJTfz33CF4V3WiwxXXk8t6lKWks= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cbdae83-6548-425f-170e-08dc1ba6e0cf X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:04:33.0721 (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: loQp43bkzH8f5gEWNOQNKW5ymUm9fP7L99ziqH8co3/36Tkfn5KjEBQpHmJeufknqP2AJLsIgkWR6fnxsl+2HcK8+byTIEbQdPXI+Xnpm5CujLyOz/+9LR7GdAybEjmx X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB5583 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 Tue Jan 23 00:04:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 764975 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2101.outbound.protection.outlook.com [40.107.113.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EFCF107B6; Tue, 23 Jan 2024 00:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.101 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968291; cv=fail; b=nh8ZnZKM1xp4c9OJSVEoe7fLyrkRNNCAB2IYAsOX005gMPd67xvPsIVoK5z4rYkw/RhaqLca05kc+Lu8fNHynM/09EibU8l6bg2jn4kxGs3cQ03X2xATrty6KgLpGrE94JpTZkLcJAFOFrxn+JPlwj/oJAd/5Pc9zA3c3TMBYmM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968291; c=relaxed/simple; bh=2BjPQdIp6UHDlcmv00uBrxqQJzZ4qHWJAJniszuCto4=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=RIyT/8xbdwA5M3gN/F5PQYoEI0c372ccGBOtIaUaL2dZRP/8TjSOBLQLf4ieOfX+FVftRG1sIztFqKSO9n593JB5rt/5xOMsJWCGSdrAHOnZvZudse+N3pi41LxsFFKE9esOQRQzNa11S1z0CwnsSy+72ITxboB9RWIGGYjuVxs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=USOmf6H5; arc=fail smtp.client-ip=40.107.113.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="USOmf6H5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsI0Y7u2luRmLzhso2sXHlvIFwzNwnAwwOXPZH4vERvdqdYaHtt0HBh8h0N66D7ORd5LKQ+6qzbAJu7V4VYPJUqPW/jHM6GvJjj7u84zeAi/pz8L10zMZHeKOMxCUoP1aLKYZ/IUZZ2yBeeJ5KPFtzlU26IpB9SHiCHVG/HSB7AiPWYn+KmusEPq82HVhC6JvVXL2qfwVGbtFtjYMxpyDWrOavprmDXZD9Gck++FFGzlQp6cT/J0XXu+9cByMueNCreP/02egfAoDGnJCl3pmsaka5x1+N+pft16AqHACy53TH8sHMeXwi6EMZ4W15F+j4l9ekcibk/+rbTmrTdyhw== 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=DcnSPgUK6xkl/EhElMZQiD6s7MnnIXnv9HwS0HB6mfg5zXtygLm8CySPXPqejqLvY9mRCllvWoP+5nEQHyZaBAl3pnFQ827EqB+mBS8/4Mh9KCfwY10jrozNYo0mpq1HvaDOiGscCm75FSZLbyOHuROwgcdelGcU8cWlknS2Rit7rT9dE11pvjP6/Rv4zz3cBMXPe5VKx9IhpReBlFkKJPErhIBGv0gCUOq3SezvQoylx5lpFPjp5tzSRzj3+fjZLQyQs3ZYJ7mtEgKudfLBqXfebqnEptlEWkCRiEQ9oGbtmcaqUflkXsGjxqqymLvxeyeGOoEOi31P5gmLpiWYvQ== 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=USOmf6H57fDi+OBGFgFVpDHnNJQHMA1/Lrj9hyi+FDNJALNr5ExfpJbtCvXC4v5SgQk0xR8hNP9r3LfkvgwwmbxDvrjstmhK9ASsPeP45qx4dzBqYo8wWXpfjG1gfGL5QdbCjcGk3E6MEZKIMUqZ1yeaVOd7rZI4KX2kmE4RVNk= 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 TYCPR01MB5583.jpnprd01.prod.outlook.com (2603:1096:400:40::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.20; Tue, 23 Jan 2024 00:04:47 +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.7228.020; Tue, 23 Jan 2024 00:04:47 +0000 Message-ID: <877ck0ud7l.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 09/13] ASoC: test-component: use for_each_port_of_node() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:04:47 +0000 X-ClientProxiedBy: TYCPR01CA0186.jpnprd01.prod.outlook.com (2603:1096:400:2b0::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB5583:EE_ X-MS-Office365-Filtering-Correlation-Id: e65f044c-2a12-4972-03ee-08dc1ba6e949 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R1fOf3BWvdJAE8t/MHUJqEfiRZmysqEyF8RMSVo1WQmdz2x+XCQ17N6vtL9DWjJqklRNWAy2VxGkB8rftiQgJFmH3N7oGL9fruaPN8k+lB4aRFUZxdefhX2+FSV8Vz1WAdJ6kXjnvMJAqZ9ksSAJaWV0juKPhXwJqYn40dM+McL/CPGRf/J68AsrrUm7c1zNqWyHXpLpASC+Z1JhC+MZXBuMVmhwitHh3yfwUzWeKKaOy3cwWEzVr0ZFchIMWrMPT/qpzKGV3CpnXKOePwihhA10uUDbaiLfDVzkWcba8UXa6i+A8wD/WvuSU9gsaW4kn37SQyiVEff5bzOAUyF4zDGL2mTbf12Zb47Qd/wtN62C7A+PZVfIghFilKkJ9DGeGQrL/gwm/IaARmhFPwbHj3J4Ut/BTyV1Dxlqkz2Iedf3HYq6nifnu6GgPmxIBoYTZdwb8kN/GXOsIXlx7LI9yG9jx3fcepe6PgxK/bHSB4PGZjJge3+dfzdknL5VjAgEZRVOpl6xEOyiZVTeVMc6NzrPZw2pPuPbhncDi00a2QLrnopCFBxIkUEAsxF2vFSdsTSl07h7a0zp0PjgqHEpqYkYqaLmcEYMTihOZfaGYEJlvHWHKI3qLXf5l4rMyQ1Se5kC8GJBHKiz3zZkeFe9ow== 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)(346002)(136003)(376002)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(2616005)(6512007)(52116002)(26005)(36756003)(38100700002)(86362001)(921011)(38350700005)(41300700001)(83380400001)(5660300002)(4744005)(7416002)(2906002)(478600001)(110136005)(4326008)(66476007)(6486002)(8936002)(8676002)(66556008)(316002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MdlMUkrgcYeOCCeb0jLDDu1CaXTyNSu5yEoxsF7SQzSkKCWV/JIrCUvCVrtepoSqK8w4080bVLSDzuQgAY39E5z9cNi6JdhmWNiutc0Ea2IloMbkuqZ/9Z6OV2xqufvDDliw/6/TKYrtQ4B27yQmU1VEuFfS3LeSMR8D8lycjLiLbHIIHQ7ViUOVPwBariZEfx8t6jaHXHuUYzKzmt/F1+FwtApsqfnFCwOJmns+h/TJHbhKW9/jnI1UB4GIeKpAh8eE+uvxVqanYqxwRIXJj6g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AkC0aFnaQ7lDm4Tf3wZent342M37kQtPzJF0e8YyLG8iB+mlH08m76xdSkmEm4Pm8eyR9FNLOhapNty1z/TgD25K30ZdRxxLWfNrK7lSGIq6qmYX/ql4b+ZqmO/z+G7bVvlQp2FtI+xAYzz/bjEN4ZYDs9QfwC4AU/Ua+7bJI7GP2WKi0TehwzvlLevW4YfJSRYc8IwSZGICLnSLVIb7RFn3Yiu6Q92KruodRzNFQAD2va4trePxc5Z2PQQBixZqRi3Au9mRR2ibMmo0iIv+WGNWtrjmg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e65f044c-2a12-4972-03ee-08dc1ba6e949 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:04:47.3321 (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: KPGm9+44sC0qbS+yKfq1WpCFG1A7S1e4c9sA91hggADbUKSfGzL1p5MVGg9ID6Sswtr7ActM9Z+kwH8jXOiF7foWiBywgPPZIjRrPuBgqEMNoYvRxUJG0a2Sh5qROw/M X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB5583 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 Tue Jan 23 00:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 764974 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2123.outbound.protection.outlook.com [40.107.113.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B50E5231; Tue, 23 Jan 2024 00:05:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.123 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968305; cv=fail; b=QfJPqbuNiEb307z1PV9Huy2dCRYRJrNJ/Hffb0zKgppe6DnQBV4iuR96T63ZuQ7TSmLb24e3Q+dQSz/4GJ0ogm54FGYrvWOGOQ+CuLO8+beAHQiyCNAkwhbEnOWIVAVaHrDVAMtu2q4e1EdfYenehE2Yr3gLPYb/H2BamPUOBBI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968305; c=relaxed/simple; bh=qJH3kQTjmsJfD2prCTK3MIezU0QSxHVYSkCk/IduxRI=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=fX2tcfbSR8wgzcYOWOcR/3dkC8P/4ZgoaznGZcUbqLNtv0J74DeQHfIy2Ml45l1WxxUBsbsosdh22z9Um1CtfmNNzmgnI95WyVjCijClTwTjEY3QR8eapCC1qTnk1Lh6MA0GbhOILGLsBsGsR8m+HPPaR7sH07UqMmx3b2l8zPA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=ZOInIsBE; arc=fail smtp.client-ip=40.107.113.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="ZOInIsBE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HKBz6qS9z81u8eBDIa4ogYMCuB4VnvLVipAB+06urY7m/z7VHYLt0XErWr4Vx68KqgRYrwRVgXiEXr0CODSl1JIveiCoj8urEm68ISPhqqx16nme2UcdRDQRffvBi6T7o0ubEba9/8JpT9UiqNAucDKZHu06+coqxjoMkc6vWuhlfD0uIk8QNs/58yuHUVbMkHyyVFzWwLP+7A51KIS4CheBKsqbmjTKyl3nY1uELZFsXGE8x/AUn9D98pf93YD+eNoZOk+6utXdL5bSiinXydw5rgj04idjIwRNjMvmUWdBYs1YHSp/q4DJniQjxhdFFlk9rASZ0V9fLXi3/f1jkw== 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=RPSsntbmXKvS2rzucUWehFVtWHbccVt0yvz7/CtGjxs=; b=R127v7OoGNEdygid+dTTSmM/u/dq2fxMGeK18dvtD6a34sbB7UE2wwW7xcOuocvELmbiZHKEUSmCi7LDhpf6WbHlaM4M5q4Q8kQcRgYDu63mGoFcqnsZcD31BK9BDj4IdtFQ0/gFlurlG2iFoz/gLrnEwExaobbA8FBs5Ns0LhMRYr9tFIXFV9HmCoUeSTGgm6CvOTDdA2SUTTBL3oVm9itpYEhJ7Blg9dxg8BlP0UqphA+kzwyXJRTjv4/9PJ05mnFj+4FQ5rsIDOWpik6EZxGqaPC/rFXh5KxCiHINv3GYw4P5JiYwAjXorhJG48Jt5wEhUw7B7fIiwLjTtjy4dw== 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=RPSsntbmXKvS2rzucUWehFVtWHbccVt0yvz7/CtGjxs=; b=ZOInIsBEOkXw86IXVCAKfi49oyOq8FoO2beuLasjVRQb7S1i07NI/SHcOkWHtrQZZkWTZQYumvpJ0oSq3BBXpWmSP4pYUMkfAoEtRI4x3TGW6b+vvbTqLUxi1gGatFrTsQxtNAyyHu/nhYq119BSX9Z5Xv7jTXx/apTblHKGMJw= 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 TYCPR01MB5583.jpnprd01.prod.outlook.com (2603:1096:400:40::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.20; Tue, 23 Jan 2024 00:05:00 +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.7228.020; Tue, 23 Jan 2024 00:05:00 +0000 Message-ID: <874jf4ud77.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 11/13] fbdev: omapfb: use of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:05:00 +0000 X-ClientProxiedBy: TYCP286CA0358.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::9) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB5583:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a0f66c0-b169-43ee-5cce-08dc1ba6f14b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LEoQOrmr/Bfg/7536AB3jxurNjdQNNPNoYWqfXGVcxWx7RuebXE/f/93uDn6X6f89IvhxEItZcU4jBEgkoolZQHD4HZmMVUdNDW6dzdCKEL/7f0M3Fv5wraLGpzuVUW8SV3mLQ4q8LMqqCRdunb9gOkuNieUAuW30e/wD1PbpXTY6wv17oCej5iQlezfguW4/LtGQGz8NLD2A8xtVJ7qbFmMsIZjnI1kTi/ZDvLRzbxCWQsXYjsHRexrerkfXLjz5jaILxNoiuGi3ugKdcHQqVZNh2/ZoIcPA8rBI+soICoxEbzhZkSZETGHuHmgrusS3E+uxBdSYxnetZaIMxwzTWtal3aHnUQcUmmblzsxA9NlppVnRwlIgyhjhzATTVn2eLYuz3VESVNtmc5DnX+YmatlNrTak+QbYmkeAg70Al7n8WZmgmSgEv89KZkoYRhByLlEpaLuwE+HqV9BmjXSMfl+dohiLLoTH7ZvdWV2UESQpQKVtivQodHXvgCqtaG2EdKXgOmgRFNro2f+WxXSGWl2GT/3mEIMJu/jh7faWSoB5S2FLdj3lCGGmjFh1fNhTA6mmVHtAdwrHhbgBKTLYTQ6Fnh/452gwfXLOgtItmkSdKJOhiwjoJb68HB++Zgb 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)(346002)(136003)(376002)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(2616005)(6512007)(52116002)(26005)(36756003)(38100700002)(86362001)(921011)(38350700005)(41300700001)(83380400001)(5660300002)(7416002)(2906002)(478600001)(110136005)(4326008)(66476007)(6486002)(8936002)(8676002)(66556008)(316002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2dFI+OvYKoH+rpSE3sAFBnEFGYGRaUM66vANePNpTgpA9QAc4Diw5eR1Ieu2WAFhTrJ1ypx4rmjqLPkm0XpI5FDkLLyGEgFNRbZi3SrOyfk6rRxylst0DMQ1Toiem1/dcBX5dvk7i0jDfdnSDM34Ue5wkV59PIGKBVVFfEV0+vgolqiSirrkq8cnDmKGsRN/DheMqGvzoD4Xfm5ffaCSpJyYfOsTbk2hN6cIDSk0z+3EMcsCBYMHaV0QxdUfXAzmINSD2raZwl2OFqRfaD5lNa0g7jUi+DVSzI3GGCYXlHt61QrQmTGnCABh5CJw0LLUBF7IW7kM0F02toa9qLB7CtQ1xk7tobevgF1Y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WpNZC39d3D+YsL85GEYDx8Nehn6tH6uBaI+yeF8s4LAkNnVXJe1huEguxFZDhX2VuY7gPMCajLWMB51QEMEXY15LBGgD8xVh5edKvSRdGYkFAo7nf+2D2MILO/dfN8s5tklllZR7wAIzV62/Xg5LqbGR15679BUqyYIO1tb2KseJxwJikoeYi0hM+BbmR+p/zheiGpZPHOewZ4NsA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a0f66c0-b169-43ee-5cce-08dc1ba6f14b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:05:00.7676 (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: pg0rreJ8RBEooRzVCs01T3CRDu2PloRTRjlEcKwfLSFMX5EUpGw2WwZsYE+43PJAAyUKco7e+YfLR7vx61shAa+g0NrmITd5L3XKeWQo32TH0cnknVa/xmkCn1DmtsLb X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB5583 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 | 8 ++-- include/video/omapfb_dss.h | 4 -- 3 files changed, 5 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..cbcc10af29b6 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -922,7 +922,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 +953,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 +969,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 +1000,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 Tue Jan 23 00:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 764973 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2123.outbound.protection.outlook.com [40.107.113.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2888DE56B; Tue, 23 Jan 2024 00:05:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.123 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968318; cv=fail; b=mbRIdz/XMZuEveMKDkbr3w9OV7mKLPR3lWeTEsdC6EpDSdtkzWx7UCZWcftx9CMRGjjNoMNBXLEoYsemB4Em9gJDiYBR6zSNm/OgINOVFQhjA9GW4skpKKd+Q1oPWFbzPAFSCy4Y3/exYTSZ4p6ONQB9u8i64Eh+rZRjCq2hsAo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705968318; c=relaxed/simple; bh=Y6kVxd7KIkDnhdpNBH9XtmpjCfNEgN8FLXDGZoRSoI0=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=Xj3Euei2Pg8uuTxSD4pobF9VCLLpDVPwFS3sqr8nKLETiGYe8hCHz7XxIJKjKZwUK8hZYyg065qG8sa9wHIfmiTSzk+1ZL9HudYiC5oazjN7VLJpY7LhKBriItFviMNpzCGbbm4oUfWt2dwz7S2ftDfwUwsM/thirlXo80Wh6AI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=TRlFrEEl; arc=fail smtp.client-ip=40.107.113.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="TRlFrEEl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OzEf9nY/emCCZMx8DXEdAIBwQt4EzDhr3G9UVaPstaPwF9xZ238SYaPLKBYjWTN7QpYPq33DGjVPmPPi/GQ3BEhqyIArXyMJ11jcHwLg44CdEUZtWLLVKTEWKORIJ4fnjnyPTHjH7WFNr0ikhXax7m0PjzBe/+oDRNSyOLQq0DTWezYxlL5tQZrZhLXFuQUZ4B9N4Vlp2SrSbC0sQ+FoPcjhYKUeA5vHQCEdDbIQi87xmY+iiIODPOOXhnrH0f7v1Vup99Abx+eoD4XWH0YfvUNxcNs7jyNX8j9XYJr4FdYtt73/xMySwUBxihXj8EelVuh1ijHGF7Z6ktkCqNqbWQ== 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=Z+e0kuCL9lYC/SuDYXiiMbN9HD6rHmYXhP/eXxxP3i0=; b=hcc1x6nCTdI05I3DlziZdyiAzA4eD0iT9pec8WXUnf5fqoj0CiIFMCzaVyKaK5WhU/gfDZqRNW1vHduJKs3QBRUGejIFezo+v9j9oqHCZ6DYBaB8tNuXKQVPAxMjECUXEdp0U9iKThh2M7EGG297+bPXedLABCvyHY/k9IPBozv4P3TocycBgZoN4cfX6d7HR7O+vRLkLK5tCamlTSzKBYPPqthSuFmTaUHouTkaWDkHOkic9WKT7uo7xGXHzAOpEVFRZO2iu05hjhRwl0psBE3hyoqDrz9q45TWYNtpg/XTZ8r893L6HWAfBrzLJPGTLMvDrxTncQpVKLQ6vhFW8w== 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=Z+e0kuCL9lYC/SuDYXiiMbN9HD6rHmYXhP/eXxxP3i0=; b=TRlFrEElTy5mK4sdSFJ+Qphf6QrOF//sWy5TWCYiIPAXhCssPLsYWFDdLlH246tua94I5ufEWx6RdccQynCkRBKhmOUB2H90MMf3aW2/4j/L0CGtBM5VbTIUtAo+CyPK/pLVqNOzEgqOOulUvajo7msriDUiWDUGg7gYzCnIehU= 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 TYCPR01MB5583.jpnprd01.prod.outlook.com (2603:1096:400:40::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.20; Tue, 23 Jan 2024 00:05:13 +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.7228.020; Tue, 23 Jan 2024 00:05:13 +0000 Message-ID: <871qa8ud6u.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto 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: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> References: <87jzo0uda2.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH 13/13] fbdev: omapfb: use of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Tue, 23 Jan 2024 00:05:13 +0000 X-ClientProxiedBy: TYCP286CA0044.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB5583:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b57cd2b-a461-4c99-b057-08dc1ba6f923 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wNr63tAtAjeS3nSBgMokSjZufHAmeRAgaGSoAocL8uTgPTIG9hvcPsu/in2Z/BxhgJkvESSMtEhCXQNk+V/ACMNFWNcGjTR4iuUQ09z2GLjtUBc2CaeyTrkIeO0aKDoSIHYtiKMrbLvBW091dgrwpcR2q+a9XZLBKM6Y4P9+8yWaQvxLwMN4kOtvlBMxBwrk2POd+he37mUvgCOm3jxJ17inA/P5KoOfvpRUG2+1PiE2J+LEiMNlNFEel8BXEL5oQPtEEnVBer1xU/1B465oJmzl3RgVrAPsSVNDxBQY7fmPdbaZsGSazkGJobGPC9zuWI4qX3w5xrUAbl2Bb9Is9D/3gYL930VaKUfgBJ2ZwUd9sgSDvNb+EnS1BshKnBa+7XEAP8ZPIvzTd3pto2Bd9jT8yLoahi5LACkYmgSnW8PElOoshgquLeclTR3mkz4J1sn/znzEPdCo2U4hrzZKfzTWcD10HgpUoqkMFsdlze8qXBeD6/FJxu5wpPOX0A3RUKwahRY7A1lZYaATJmZ5J7RcVkJlL26BGP8moCscaR74tx+nQLNlGJfpWt1Lgw1brqdstmJit4UZ5QR+zFTINwUb6DzIMj8bDK0FqcSnJx1hZsJFmSONixz8eVu8a9qLnAHArgR1mJpQxwaS5w1e8q88Nlre2pFnyKenEoLmAbY= 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)(346002)(136003)(376002)(39860400002)(366004)(396003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(6506007)(2616005)(6512007)(52116002)(26005)(36756003)(38100700002)(86362001)(921011)(38350700005)(41300700001)(83380400001)(5660300002)(7416002)(2906002)(478600001)(110136005)(4326008)(66476007)(6486002)(8936002)(8676002)(66556008)(316002)(66946007)(21314003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zCd2c+lN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dCOwF0WcA5TsXYNE4JqqWHvJhj7tkXp6cpoGoxWG1RqYlfDIy/vF49jR/524Wniq7NGO95PKVoa/hNQr9p3Sf/T8q6zTVBspxGxP4GyO0IwXZGwoyTuz2qD2wcfm/GKtWwWxkSAiN92aorEDrGvmA2Atb4Ug42dp7xNo7iIxFRAg3Fh9qfyOlZnVTEjdxeu2TKxJpQs0qLG85Ol/ymn4cgcnMjI6KS+hnmrB78i635lrZpWgo1tVpWWjJVQx9Cmg7T0TwtFz0giWfSqAgNmq0mhgpdiqKMD6cVZg2VTkSRea3Dajo/s9y8Mte/LvTXQQ/Pzvk/RVhKPKeK1H9FtVTRMVx72OlSw6P2srq2H8RHYVTmtZ2Phyrn/PJPXX4msycTShlOId+83nFdy9hmzdVrbZeRRPVjwKFZCh57ejwD1TQAul7PmKArW2IId1uaQzSqMihLqz6Ajf9A8oyXH5Y3dQe6rDpV3ABPVeou3LqFw9QawvCp4u5QbbycakzYPbvrCpgH6G2beOfx0jPoh5CFXtcy8fAcZhtj7EGGhd2FihvkI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b57cd2b-a461-4c99-b057-08dc1ba6f923 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2024 00:05:13.9003 (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: cIaa/rzeMhbdXx3a+WOa/E1OEOEkn/M73pVhnR0V4O2itq9GMbk/P4jhrvY5MQY9BfA4McWLAj3pPWsKdgx1g82jE0OVH4j8GuZKrLdrJcXptvqI4ez4vOQ9g/z1g/ot X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB5583 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 | 2 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------ drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 2 +- include/video/omapfb_dss.h | 3 --- 6 files changed, 5 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..7a13c4451855 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -5079,7 +5079,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..ba84ec179ee7 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -529,7 +529,7 @@ static int hdmi_probe_of(struct platform_device *pdev) struct device_node *ep; int r; - 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/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c index 03292945b1d4..3468a3c22a65 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c @@ -561,7 +561,7 @@ static int hdmi_probe_of(struct platform_device *pdev) struct device_node *ep; int r; - 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/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c index c9d40e28a06f..889a28694b39 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c @@ -764,7 +764,7 @@ static int venc_probe_of(struct platform_device *pdev) u32 channels; int r; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_next_endpoint(node, NULL); if (!ep) return 0; diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h index fc106aaa75bf..d133190e3143 100644 --- a/include/video/omapfb_dss.h +++ b/include/video/omapfb_dss.h @@ -811,9 +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_first_endpoint(const struct device_node *parent); - struct omap_dss_device * omapdss_of_find_source_for_first_ep(struct device_node *node); #else