From patchwork Wed Jan 31 05:07:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13538754 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2131.outbound.protection.outlook.com [40.107.114.131]) (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 C4E7D405DF; Wed, 31 Jan 2024 05:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.114.131 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706677661; cv=fail; b=fGvmN0PpCIJ48L3BwAgsqAT4yUkGvozb70oQRmYVcgZdyYIvo+e8ed/w0Li6D4BinQwFFuGhrDD00nkTs1yYOZTDwwTS4+BnOL41S0R5cQpmaoiLsrDD4BPkPdgF/pP11nBAFO7NgVnNSMtOTJ7DxXSPUAj+GWHm0WaUd4RJaZQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706677661; c=relaxed/simple; bh=5VAs1KQTNTzCnb3g7QL1QAT/oL29+yJC87qcISM0iWg=; h=Message-ID:From:To:Cc:In-Reply-To:References:Subject:Content-Type: Date:MIME-Version; b=C0oN415OLtd+k6s485DO9VuYS8vGTasiaEmWipsSs/FTs19Pr5CylGsThoULlH/m0WdyKYPrCrYrvpz9sgypi9/DKD/lSPVjlucXbljwAsIIQiGhyTFZVB8/b7M0eYxTRu/cqPGEygXSKxHLGlXpT8Ze7aW+4V2k9lrjdJoQroo= 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=deLkzdZl; arc=fail smtp.client-ip=40.107.114.131 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="deLkzdZl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bTwORU4PyfsvTYc6pKQE1c5VPLShX2mSZdQvEzYufy57Wu/4ucLBEBMLGE4Ttudyd6mYRqRxg+GsP+3lq5GLMJ9MGCt9a5CT27Z5rd2fNx6CNkYH9A8OhQx5XyDJty/2rY5gGabXOe8Ua3wmCKf8WDPc7SiibqYS+i2WjgN0pgPy3EoT3JK2yJ7x8FrHl2og0D+304rCeEIFvGSuk4huMWUu6bD97xbVIWPlPaVfuF3X0yqhQ0LqNMMk6tO421AVCF//TuasBlC/95y2wpHmijuZ6Q3TDsmv0wVMX7LwC7Sm3gQvNN4Djv/Wy3hhs/577n3AKyGhh+D0aDZn331Smg== 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=lvl8axl/47jFTzyFzdCExPfKkb9p86cqwH4KSx15FOMELXurdZnzCT5scVstjqQEkSw+uGqk0env6EGZOZ1MT5N8m1cYHTsZ7mVsBabP5i9hcWruRh6Eh5D3OlJOZeroAcGWOtinotT+5lqzWTongIYDO3PrdSeUDQZtDoEf3Lfd+3oCHZXz5FS1zL/lmrDP/4hB0yVi7lajwIuo3BIoWum47pqRAENmOwPEmHUofO2P9SZgEfxZKm2fi3HCwHcfbj51LEaq1eFpyGiGKmyD3Lc64+pbmVUQUw0N5CySoofiiox/UgGmF+MVul1LaUGJ8U2Y8Y3TgmgXXs2cU5Dq5g== 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=deLkzdZlxIDqN1cld+awIMzVjJki6ZTsNZKoDljX8FQfK79aPqdvMMZoiKYqFHX72SjhQ6v4bpw8yH4pR3lUjrfz7umZj6kUzDpGvvAFAhwyE7swDGXgltf9t5hZpr3bbuSJgUyuSySmqixK0rK7JLsEUGs1OT9dj7j3oQQWzkY= 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 OS3PR01MB9898.jpnprd01.prod.outlook.com (2603:1096:604:1ee::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Wed, 31 Jan 2024 05:07:36 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.023; Wed, 31 Jan 2024 05:07:36 +0000 Message-ID: <87sf2e5bvs.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: "Bryan O'Donoghue" , "Lad, Prabhakar" , =?iso-8859-1?q?=22Niklas_S=C3=B6d?= =?iso-8859-1?q?erlund=22?= , =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Abhinav Kumar , Alexander Shishkin , Alexander Stein , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Andrzej Hajda , Andy Gross , Biju Das , Bjorn Andersson , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Dmitry Baryshkov , Dmitry Torokhov , Emma Anholt , Eugen Hristev , Florian Fainelli , Frank Rowand , Greg Kroah-Hartman , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jacopo Mondi , James Clark , Jaroslav Kysela , Jonathan Hunter , Kevin Hilman , Kieran Bingham , Kieran Bingham , Konrad Dybcio , Krzysztof Kozlowski , Laurent Pinchart , Laurent Pinchart , Liam Girdwood , Liu Ying , Luca Ceresoli , Maarten Lankhorst , Marek Vasut , Mark Brown , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Michael Tretter , Michal Simek , Miguel Ojeda , Nathan Chancellor , Neil Armstrong , Nick Desaulniers , Nicolas Ferre , Philipp Zabel , Philippe Cornu , Raphael Gallais-Pou , Rob Clark , Rob Herring , Robert Foss , Russell King , Sakari Ailus , Saravana Kannan , Sascha Hauer , Shawn Guo , Sowjanya Komatineni , Stefan Agner , Suzuki K Poulose , Sylwester Nawrocki , Takashi Iwai , Thierry Reding , Thomas Zimmermann , Tim Harvey , Todor Tomov , Tomi Valkeinen , Yannick Fertre Cc: Alim Akhtar , Fabio Estevam , Jacopo Mondi , Jernej Skrabec , Jerome Brunet , Jessica Zhang , Jonas Karlman , Laurent Pinchart , Leo Yan , Marijn Suijten , Martin Blumenstingl , Mike Leach , Sam Ravnborg , Sean Paul , Tom Rix , coresight@lists.linaro.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-sound@vger.kernel.org, linux-staging@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org, llvm@lists.linux.dev In-Reply-To: <87o7d26qla.wl-kuninori.morimoto.gx@renesas.com> References: <87o7d26qla.wl-kuninori.morimoto.gx@renesas.com> Subject: [PATCH v3 22/24] fbdev: omapfb: use of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 Date: Wed, 31 Jan 2024 05:07:35 +0000 X-ClientProxiedBy: TYCP286CA0296.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c8::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9898:EE_ X-MS-Office365-Filtering-Correlation-Id: 876d630a-0860-46ab-7388-08dc221a8a15 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BJMYeMNXQ0nBGLjuT5tIgleq+YMGZrkQowDrcNT1p/c9sHFMXjjnvUPloGaw7OfCV4tUHxdPbTjGsygOwW9OJpfDHO0d2TJeBOcvIALSGMFq1aJFjCjJRAP9Zrt1idRccIMbag2tE36puIL0YZc/8543EWAVE/rmIoxxJMYwFdySV8PjBIlQBfhyRV/l3CRkmH7ZEUVZVHFtN8arMzOR1yD6mRjydOhkLEItFSQNrh+haIBKrOCQFVifDHOyf0xc9l14ZMW+rnnNEttBwIeFakdIWfajhSN6deb0yEhD35e5yjGWi5PTPi1O+OrxP5fSfDewlycRbU8POHySxjmCbgBaVL9MuciyOgfr2N4vqzNqNlMJebTsb1VzWkRadT8CNZjOQBqw1s0JqJNq+n3E/B67NUtz4Fnv3WmCViJ79uPDFuHxf60DjJgRlQfRbdRtt8mnmCfPuZPw0w+ZBzUecF+evfmwF3Lk3JSEHwKSQgKc7PKU2CJF5v29K6TEwRZnmVrowTcZJGExRDJR99wCaKkMjNy9g5/n56WyppFMcDOJk4vRGqB+iAHmza99M3u+Ey9Zdl4Lc0KD3RED5Ivn66PwOG4k2I39LiNYuSP0eAOhwh5LT9bnS6JZXmr9S1I3 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(39860400002)(376002)(346002)(136003)(366004)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(1191002)(6486002)(38100700002)(2906002)(86362001)(41300700001)(36756003)(7276002)(7336002)(7366002)(7406005)(316002)(66946007)(6506007)(6512007)(66556008)(66476007)(54906003)(52116002)(110136005)(478600001)(7416002)(83380400001)(5660300002)(8936002)(26005)(8676002)(4326008)(2616005)(38350700005)(921011);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ecu1GgNgKzdD+2h48ZLLfGBT5GXCx8/VetvzxrSMCXtSHAwWX49WvCO2myd1dwXeAeMnhOZiWxtlBDOXp4g4ebhcrkwuoONLMOdxJIELlwfMhyTB7o+P12+FZIoQeJr55A1kV1Pukzu4lqRKCfy6YbKrBivki4LICO/j28ZjZTyT+fn8oqiJ+aCk5lLLG1I+cSXAii2r+KmOm5PNAHnvnogBqQQIaLJUm3PARf6saf05bsm5Bt49B+m+i1Q5w3e66Zp4YVQ0wjpr3lMl8ajnqW19ioBJ8Gh0crDSnYYUdsToG3iPZ1Gls/kpfFK0ccqKkUV4yDdra3XxcM0R06G1iiIox0+iPtPxaT0R+y+nuL/9Tn1RDcOsRRdZ5z8qIotTmAFR2FtTRlxQLY2uLsWSSvjtXJhr0krT2wMlmOpburWTf+Ivhu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wOeddqOSUbRskAUsvxhGztCFUNVwzfLowL2D/sGStz2JFBPwYxfVnNB0oT556YZ6db1s9rbVQldcq91/WPOqWxiZIlRZw1Q+XNjpdljvToAh4AFMfNPx/+U5Cb5EZHwuVwRfyQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 876d630a-0860-46ab-7388-08dc221a8a15 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:07:36.2155 (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: 2eCxHTgLvwPffqKEP4Wq6NiQ3zkiEhd3RxENPSweaJ2O53gdoDDrLvwaz2UtziL7enzyNRMJIbecYShHdjCI4cn473p5bHZ+12W5BA2Q/Zy4UOydtQSG9XiuhBB+Shbt X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9898 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);