From patchwork Mon Jan 29 00:55:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 767515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BC4EC47DA9 for ; Mon, 29 Jan 2024 00:58:25 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5E23A83E; Mon, 29 Jan 2024 01:58:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5E23A83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1706489903; bh=5VAs1KQTNTzCnb3g7QL1QAT/oL29+yJC87qcISM0iWg=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=uwWj9Ux6qv+RZVDXZVnWJ3hGBIvQex5Eomp/+AftccLV6VdYmrgR9kD6D9SvFDb3h fEmoDD00iNnfHmuBw8DxKV/PXG4nU1Pa8jd+TzU9iwNUj7ABc0zswLQ4yM7+5IP4hg FyXDPe3HbSJ5pJ0VIaVew8HmxxVwunyo9foZ7xdo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 46A9EF80624; Mon, 29 Jan 2024 01:56:26 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 6A85EF8062D; Mon, 29 Jan 2024 01:56:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 16F0DF8060C; Mon, 29 Jan 2024 01:56:23 +0100 (CET) Received: from outbound.mail.protection.outlook.com (mail-tycjpn01on20700.outbound.protection.outlook.com [IPv6:2a01:111:f403:2019::700]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2E91FF805B2 for ; Mon, 29 Jan 2024 01:55:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2E91FF805B2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Z0sfHBDl ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ciNOfKRuKuKAnbnKT2n8KoJ7insCDhZiwJm4txWkC9MEVh0dn2pHam8trgs9BPExxC4zhp7X94T5tDPJtiuN3wAdhcacO/S2R3TP7+OOAlxDHlLVyyOQmd1+t8d/F2l3epSS+HXCVzlJbS6yCrDogc/KUd+iq0tSeqAxSKP+CM/EbeqjR2mFm20CWXQ6Fp/C8K8DfQVn2hemAHztG/TZhTno24fnIFEQ5nMrfiTzctG+EPlasBbs4ud+/74gddnwCuk+Nq9lRseHNV9aSEgeNq0QcOI9eYe65+FF+heCfLBVU18QPKxxNqiGYM09m+VAv+ftZDxH3EoAfePDeVKTyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VkQMqMHNzGBNFV13iuUeVRTw/iMGfmTezXaXKaO5b0M=; b=V+CaZ3lS8yuQjX9lV5tBV+lzPpDPd79ezHnOzmsXUoMoPNulm2chRFxTBFaVwrYgEVJOPlbjLrC4r63QLZ/loWeqerMYxwVXW/Om2Z70o5LRxupDtsAp+FfRNRyEumhVans/v0jHGHj4PtAww0u51JrFlNQLxzITMrf4vPhIzoLmGhHShxgm30FyX+VewL4hPEmUuaY5A0nvd0sGnhPGB+iONdGrEz56GyO5yFAn1rDq5W5Hi4PZvBfOh07Ggn6kywFDtBoBymxgo/KVPz3BIFmy3zzSxu4hVIXJSB1N0+rfSOys4j9tbefGi2DB/HrQUVcWVWo+pY7qqybZ5a4crw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VkQMqMHNzGBNFV13iuUeVRTw/iMGfmTezXaXKaO5b0M=; b=Z0sfHBDlHpiAuJN+9qoxWMG02sESVx3jQjFwik4pTzX4uiGDR8t8xrIg5CreutPyYQsuwWiBQZ1mooEG2Ok8WpzRt3WlnQDRzyf6fyc0hKuv1Pq6Aj5rg6AqK53HxI4BJs3yHuLvO7aANPEjGLP1Wz4tojxLh0wpM7MLGnbr+1w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB9881.jpnprd01.prod.outlook.com (2603:1096:604:1e8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.20; Mon, 29 Jan 2024 00:55:40 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::ce8:8f5e:99a0:aba4%2]) with mapi id 15.20.7249.017; Mon, 29 Jan 2024 00:55:40 +0000 Message-ID: <87zfwpj6ur.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 11/13] fbdev: omapfb: use of_graph_get_next_port() User-Agent: Wanderlust/2.15.9 Emacs/27.1 Mule/6.0 To: =?iso-8859-1?q?=22Uwe_Kleine-K=C3=B6nig=22?= , Daniel Vetter , David Airlie , Frank Rowand , Helge Deller , Jaroslav Kysela , Laurent Pinchart , Liam Girdwood , Maarten Lankhorst , Mark Brown , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Rob Herring , Saravana Kannan , Takashi Iwai , Thomas Zimmermann , Tomi Valkeinen Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-sound@vger.kernel.org In-Reply-To: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> References: <87fryhklhb.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 29 Jan 2024 00:55:40 +0000 X-ClientProxiedBy: TYCP301CA0041.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::7) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9881:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bb41083-3608-4840-bbbd-08dc206503a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GfbepQvUFeMHclDTSIxFmtz4yQJVDrpVsaO7a/Pmw1qx5r71ohzXCDOwZA4ColP50OcQBwe9GBrPKgGBgHtpRUPOrwxSu5F6NdmU4zQhmvtX6fKsnU1VgToXsLfPbwGBc3/TB+DhYg9iv/xAHvTuv2zWKfE5kIE9z0RPwmPW4XO31JrRBZD1ujNbqiV43OpDUplmCPY9ts1J+W3+IDj7HadRUXEb6Ltoafx/DDVnWXc+2V9BF8vBfpIrNQY1LcphQGlkVshaKKzHL9wdQmehkF3xbiD/NtDP9/CkcxXH5Gw6h6HC0Gk1nuFegMJYiA+KyIOkkUyX3m/pS3pdC+4cej1XLyYM5l8/p5haJ3PaBFdHSm2ioyWl7BKmSOfh0CQ47vrLVIxwYoORj61X9FGEWIg6N9EhdvzkG3QM05rRpzEGEwiBA1g3Jg1GlIg9q1AEE4jakmiIJmcgF6siUhb8O3xggrgHK+kVW3A2+r0Z+OI/A7LZyxXTr9IaPLIuyAwqGdg+aAKIz5AW8Z8HtHJspThVadGkHcuf9IlbH+YuK+hRNJqbUrjIFYqXgebqsvcOXnL83syziBE7JJYjP9qfK+4gVhtqU7j/xWaxbX12Plvjjg16hGq1sTwPU76v4Nad X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(366004)(396003)(376002)(39860400002)(346002)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(66556008)(8936002)(8676002)(4326008)(2906002)(7416002)(5660300002)(86362001)(110136005)(66946007)(66476007)(316002)(38350700005)(36756003)(38100700002)(52116002)(6506007)(6512007)(478600001)(6486002)(83380400001)(26005)(2616005)(41300700001)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wOEXD6nsiBVIFRHg03KcVoPw/B8Z1ASJLWzggrinmpcUuA+IUpGDXyCq0bp0c446lZrNxCAkXZV1M6yoC7BTuNbV74P2RYFfiEsF4koQMxDTBT7eGMtjCyqN8H/mTAYVMYtSjuTwTEnaZ4WIzGJ5PTuK3VhvToLoyNvNJ/2YePPxK4Mu90Mx5Xab3snsmUAjd1joH+F0TwEXUTSyf8KrL9zYWUs2vG/jNOHnnzHgRg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ZSnYS1fNb8f2O9EzWUJHe3uCfclfPERnRhVkOb9edBvr/15g/Rz2Wz1niFnNSBnshC7wioQG8itwk9i/+0Me1VnGC1foVVq4HCDDWDFaMO1Zf7f/nADkGnxs8e+wrdhMpqvOctMB+CcqzyOdqeNz7BfYUqJxA9YHsbdZmOAUYp7AV2bqxsoUyY3GBZPPT9p6HlniymH7zOoLRaOHanDrqjvHFl4Bxz8nU6Lj6Uscym5KeiMMvcWSt4D8mUJ3fv+b7K0dZU3H563/B2rAvGnu2zrzOqmXDJ43CG8v9MWelpGgH2SMOGwXMi8o6O0msGhFcH/UWPO7waFjM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bb41083-3608-4840-bbbd-08dc206503a4 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 00:55:40.5777 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X7wjZT301/s67SFJTrRDfkkuGspy3a1i3QDDRBpHNnF7hfqmDJ31oCPc1NlNLAw/utvlyXBPKjxpOZRj04A+FZCMbZzYklfv5j8DeyZXgN2f6cJq2uBm1ZxuErL5z+Cq X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9881 Message-ID-Hash: DMCNL2VZUW3QVLACNQR7IBWJP6X7Q2TX X-Message-ID-Hash: DMCNL2VZUW3QVLACNQR7IBWJP6X7Q2TX X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Now we can use of_graph_get_next_port() for port parsing. Use it on omapfb. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 48 +------------------ drivers/video/fbdev/omap2/omapfb/dss/dss.c | 9 ++-- include/video/omapfb_dss.h | 4 -- 3 files changed, 6 insertions(+), 55 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index fe6c72d03216..321ae18f2747 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -15,52 +15,6 @@ #include "dss.h" -struct device_node * -omapdss_of_get_next_port(const struct device_node *parent, - struct device_node *prev) -{ - struct device_node *port = NULL; - - if (!parent) - return NULL; - - if (!prev) { - struct device_node *ports; - /* - * It's the first call, we have to find a port subnode - * within this node or within an optional 'ports' node. - */ - ports = of_get_child_by_name(parent, "ports"); - if (ports) - parent = ports; - - port = of_get_child_by_name(parent, "port"); - - /* release the 'ports' node */ - of_node_put(ports); - } else { - struct device_node *ports; - - ports = of_get_parent(prev); - if (!ports) - return NULL; - - do { - port = of_get_next_child(ports, prev); - if (!port) { - of_node_put(ports); - return NULL; - } - prev = port; - } while (!of_node_name_eq(port, "port")); - - of_node_put(ports); - } - - return port; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_port); - struct device_node * omapdss_of_get_next_endpoint(const struct device_node *parent, struct device_node *prev) @@ -122,7 +76,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent) { struct device_node *port, *ep; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return NULL; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c index d814e4baa4b3..5cab317011ee 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -922,7 +923,7 @@ static int dss_init_ports(struct platform_device *pdev) if (parent == NULL) return 0; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return 0; @@ -953,7 +954,7 @@ static int dss_init_ports(struct platform_device *pdev) break; } } while (!ret && - (port = omapdss_of_get_next_port(parent, port)) != NULL); + (port = of_graph_get_next_port(parent, port)) != NULL); if (ret) dss_uninit_ports(pdev); @@ -969,7 +970,7 @@ static void dss_uninit_ports(struct platform_device *pdev) if (parent == NULL) return; - port = omapdss_of_get_next_port(parent, NULL); + port = of_graph_get_next_port(parent, NULL); if (!port) return; @@ -1000,7 +1001,7 @@ static void dss_uninit_ports(struct platform_device *pdev) default: break; } - } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); + } while ((port = of_graph_get_next_port(parent, port)) != NULL); } static int dss_video_pll_probe(struct platform_device *pdev) diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h index e8eaac2cb7b8..426d12881132 100644 --- a/include/video/omapfb_dss.h +++ b/include/video/omapfb_dss.h @@ -811,10 +811,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev) return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE; } -struct device_node * -omapdss_of_get_next_port(const struct device_node *parent, - struct device_node *prev); - struct device_node * omapdss_of_get_next_endpoint(const struct device_node *parent, struct device_node *prev);