From patchwork Thu Oct 24 02:20: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: 13848186 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011046.outbound.protection.outlook.com [52.101.125.46]) (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 5B13B13D638; Thu, 24 Oct 2024 02:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729736416; cv=fail; b=EWAKQtdgp3N9NsfgjTpF8KqleI5CmL0MRMI0gwln+6ao5vIXDuZs3s/znuiowhznUBgMG1dfBOn0MZWYOC06bFCxT2JpNgc8iHlWR3BSbdYveTKKh0fLRadp0Li95PdZJMaUfYv2JVl7/4XbXuAaXaQfPVLnpMgGlKH7OyZzHdU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729736416; c=relaxed/simple; bh=4po/km41IbzBP39aRTHx0ighlgt00jLE/HEciuPm1hg=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=Z81TaFHnZRVKJBvFVj1pFzyuPHbBjEEFzNfXcFyh43uUhRYZBz2r14dU9e69nfC0NzdJSyOA3cExgrrCeB80leg/njmoZMzNHduBtkvjSyxPSE5UplwGNvV3p2qvU3J9uIHA7U5kdNq3gUv7qd8YCqPSx1KlYHcdV9fabwFhzpc= 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=fO9252pH; arc=fail smtp.client-ip=52.101.125.46 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="fO9252pH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=elfEu45SRwPIBqcaVXwVUvp8w2O7C7akQWMXLutRe4IFyhY8lgUqZ6UEOKQ/8dpiJb54S4Svf0iVOCGVsoLqtUS65Wb/REqu8lTarWkD5yrnCXOaf31RGjFKvN2U46UupURt5kb9f4TWjS/KOgMO9pa1m7EQyiLMY1Dbku+v2IEPHb4k34KwPTDlgiWt9CYlRB6MfN4acljYOfcft408tdJhQFEaKf4hAw803mFy9ZjnH36vZu6h7/kCK5IrcCAsV8V3UCJSO7ILWy6d6VOgQRzjg5oUgZs88U3BuCBDeOAykj70Gzq2+3LMmIgEmxsoqzhXw9qdBfdAoJRFaESLqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G5cb4M7eUBjK5KW9qCtDhESRSmafWUFz/dmuWH0OZuA=; b=juV88VCvzD81kVIV1LtRyoH954yYBxJyi6bRJs4f1+ubrsWWgvImHy06D9CAKCK2olwa+Em06E/ehWcxvHjWRIxqdRylqnpyqpsgb7OuqSlZTU8BcEuhwIuqsn5fq+XzbKcl9LGL/h434LS4Sc94mh69PyN/FajsM0nOpO/AJUn6Q/kteFuM12Ciy6imyZXkUHfKg0uHyk308SAogqZyFngmf64qtPWm4MKMKO+TezVhbN0XiJOXrNikzF/Y7ZHGBcd4uNKdIMWvk4UGG2HQDttCVHTQyqxdxJwjQu3p77ngZ0e9hEgokUK1tjNB5BNZHyd8u4O8tdcy2z4VhucQzA== 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=G5cb4M7eUBjK5KW9qCtDhESRSmafWUFz/dmuWH0OZuA=; b=fO9252pHfwqmYYOoF47cmhkWLMPFBrNpVuLqVOSf1zlWrzQKqhe+ISIIdz/M1oWAkrE6Tl5+sKBWpTWEi748gtwby2ip9DpGwz1v2Ooq18is6ilx1eaLii6coiI4x+PnS+KojUdo+6T37fi45gX4PsoApEOGQZK4njXz0LIpdXE= 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 OSZPR01MB8629.jpnprd01.prod.outlook.com (2603:1096:604:187::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Thu, 24 Oct 2024 02:20:12 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 02:20:11 +0000 Message-ID: <87iktib5t0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v8 3/9] of: property: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Daniel Vetter , David Airlie , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-sound@vger.kernel.org, Sakari Ailus In-Reply-To: <87msiub5tt.wl-kuninori.morimoto.gx@renesas.com> References: <87msiub5tt.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 24 Oct 2024 02:20:11 +0000 X-ClientProxiedBy: TYCP301CA0075.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB8629:EE_ X-MS-Office365-Filtering-Correlation-Id: ca17f91f-7b42-42c0-fada-08dcf3d2637d X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|52116014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: lP0H5HYhbnux8gnOOr9HGa2+ze7ZBEZan5vfTcB61WtY8JMIGhEXYcFdUnPxAc1wAJPK4KJPIfViTTt23WK+4kxltu6bVBcT93C5XL+QguheV2esRZGXPaT1aOebUU54cc8jHYWbcjZs9Qb7uZ0rZvFoiwUorRT7A886KbZjGViUkjLw72CORjSYNLjUQYHplAl1cg3SoNB4Ci7ZTxRok7oxzpzCZHC+XIUyvTz7T2r1S8T5cQfReKT6ZK2tlEAff8OA7qWnJWPExJAgL2BBPW7pQzpfLJ98EpZgHfyzTLBuTn+T5pHN+ORE9VY5nccM7AusBo8WdAoIye0P0WH2fq91hJT0eh4H7tE9uWvRhvejT9fH5keXU76uMOPn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V:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(52116014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r/HDKUNCKe/pXZY03z67YcirYuZmCcSM/ZhK3qh14QuevfBVSFSEvppj9iEy3eMsnyomxzzFJPMNMdYmw+zkxf/RrxLLl82CQMrG9KQv2eUjia4VUcunphCixUDFOAYS81xzka4PVNBMPW63b0Ktdl+0/TAcqsRxTZzdpRBAejD4WsnROvc3YVe5Dha+NfEHa33xhZG0SFASyLR6N7wf9QGW4sp/wHXTngstGupinm41R8lFaEU12xQvqr5IpHpy4CqX2kVfKGQLuQH0mn9B0dY84kZwh8xs8DnfPRFBMaC8Olcq2kHrK613wTksemOJTovho1hR6Fo9UdF+9dsmJncwpZ7xlN4YuEEg+JtG4wT49V/2DoPyXRIp7ax+y4W5Y21TNnWNxLKCq+sTiFrP4fvXCtGXfI5zT1QQnJFIAU7HvRo+0aidRTRdWFcsbNVG+aHgI1Ko54Xr3/i/WTYqFP8fEsN+a1od7HgSEaw10pH50ndU0p4FCNhhvg1Lb3uzyFcLpNpOfwEKWAZ50eVGiERYTY45hB6+c5S7tHb/Ga80uSi9J46ZUzL4Ci14vgqOvz8eW2QHGMPNKAqf+FDL2yLZ8cIZaGr+P5lel0lCGheb4kE5hSUuiXfZ9UuzAkuY3Ctmjp+nzVj0A9HX+6/GC0MTPKvTVc4zoT/xACYy3iwjh/kTVXfDtBFk8B/F53sLh1Iga0y1H26Lq2utBQK10TVS1oEscbXflY46F/e+SbspXRCVi9BY819FXveUjRpkjlXXZL821O1ZAqN8GdL1FApp3SkfQoxz92Ypmt7AdABesiAXbNCtoElptjtPLITW/stfjlhcmUrLmv+iOTuOiJPqnrYJqfvnKnOVnBChw2Z5JazKeTdN6RcirXZlsvM5WDbSFL1XwIEAmsvi7J8otrdBM2In1np9uLN61RiO4p4Ppy4B8SVh0ZQWBbKFiyYS6g/3jsfuZEc0slonJr9IK91N9b5tpN8PzANyvXrl3o4jZLEl/IRB1qfL0NHXv0VYtBHTnqzF0mhlDSPCBBIboQU31/gCZbR+jp92LXIZxcF2QIjddX6Y+jf9K2zGdGHkxPHCsIaE0TRRLpbpP3hIMoIWHV8BgTV8R2f1BjvLMR76+xW0dsgQaDjQyYLjzfeBSPTbxvurl+oEBp8fnVbN5Afufospb7BzoMjIdMR3dq1xx5pC8EZIwZRryNJskY2YIOvGzEUhJL5PnEFly7w16UOBN8tzsea8gHx9/q7HWzoby85PTU/H8aOUvYDuNtJzWs6FyjDRUtw8FVT2A/2tmMlK7XmhjKoJTK7SFSz0qvgxHVewm9ookGsVtZRS776HgzL17/IQtTJaoYgpo5GQZYR9DKOM8xyI0aWoMbXJ8YxgYd2Fgtpfwu+YWgV280j8Qts84rcnGkExdBRF5A+kESFwgfKORPunpk3C509Wr+QK1qhcEMJLPSbqckNTUVNcWoXwQM+NJExtzWSVj3dmm1S7LjiBXJkzim8bAK6SxpOs+GBYHXFs/wNC61ku8aUrkn6BEQ8+HiClIekRAmlo3MgzMUYIYF6PBgz2OD+WdqNsc2j9xWe/Nn9+mpLYLr9LetCQZ35COqHqQWAwTV5evtvjdZMVjtxUd2lyfm8ephI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca17f91f-7b42-42c0-fada-08dcf3d2637d X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 02:20:11.8695 (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: ZgRNAaPQuN5aFrQ7klKsgBmkVfhJmhmM8RBiSQNJ01rJJD/+OAz4UT5RP1Rrl47SyrI7ekyneo40vTIa1DihnIQdcRkwglgfRq1gaFyQ1WvsiUkycLiHEHBIXgiGfxC1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB8629 Current of_graph_get_next_endpoint() can be replaced by using new of_graph_get_next_port(). Signed-off-by: Kuninori Morimoto --- drivers/of/property.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index fcc609a17fe35..94175289b518a 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -717,13 +717,7 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, * parent port node. */ if (!prev) { - struct device_node *node __free(device_node) = - of_get_child_by_name(parent, "ports"); - - if (node) - parent = node; - - port = of_get_child_by_name(parent, "port"); + port = of_graph_get_next_port(parent, NULL); if (!port) { pr_debug("graph: no port node found in %pOF\n", parent); return NULL; @@ -741,7 +735,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_port_endpoint(port, prev); if (endpoint) { of_node_put(port); return endpoint; @@ -750,11 +744,9 @@ struct device_node *of_graph_get_next_endpoint(const struct device_node *parent, /* No more endpoints under this port, try the next one. */ prev = NULL; - do { - port = of_get_next_child(parent, port); - if (!port) - return NULL; - } while (!of_node_name_eq(port, "port")); + port = of_graph_get_next_port(parent, port); + if (!port) + return NULL; } } EXPORT_SYMBOL(of_graph_get_next_endpoint);