From patchwork Fri Aug 9 04:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13758372 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C2CC0C49EA1 for ; Fri, 9 Aug 2024 04:23:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 517FF10E859; Fri, 9 Aug 2024 04:23:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="IZnOBqz0"; dkim-atps=neutral Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010010.outbound.protection.outlook.com [52.101.228.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id D692210E859 for ; Fri, 9 Aug 2024 04:23:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CL8gjZl+zPsZQ+sUjHufG4dvGKnlzDHjQheyqAYBFZ2sZiqxOsMv/hs7c4F+3leB+uQDGD7q4I9cB72QLjXvI9AayUqfunvgQsBJ7IiACXz1on+ppV4jnnV5j7wp5vO8Zy1/vgAU6Uru2aZ8JKk8FugGlhS9gB1tjlxhu9g+s1tOjf9LRxjq0uVb03y9SjD0ir/DIRPpHko7kupjO0eA9dwOtYWMv5HdsUnG6dnr3+FfT5k8NJ+v+UPJeo4wVRBacOnqwPRTcMEaCCdfbNJgKINQWs0wxnfWtLqt+LdMLh1AYdDoAygshNq4wFMJlgpSWOC+puJwmpwv3bdVzCSpWw== 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=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=O8ow9SgcKWeykHmjxh2nH8EyCgp+VBRj5c3PWL1/aCiZzDO/SGlhHqSP/oJNkTMsqgfOBeCvLyQaUUwV/tTsKwKpH+x3dJkthzJ15LUramH8L8zgPkURuQVeWxPGDxxB44e+n2LIb80McSnYd0pwREz7oHWbwbIiPQQzlehgezt+TracGIuuZ+srIq4kVqcI+f8Y4hHwkW+oj0yJJhh06csFavgnnJB7tl6+EHYkBVsuolEyiFEM5gNSi2g920vTvpkg4XncFNwrcYeuP5abppRDddhW1kmF08RG3mY6GoOucoLYXoiESYM903NYDRttkWxfHrsOHkafjJxSSk4hLw== 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=bqpCLsY1CmrUuWtVZbk0ujoYsWif8tltOD/VUVSoA/Y=; b=IZnOBqz00GKPu18D1MG8FMHpC3NTysmmE1y2BB4VwiIh+TEtn+iMIuqINcqBDY3vMx/1bdbha8NApJnxwbIt1t8kQ7aFDTTLMqf2oGA9KCTF482HvBZursQE2mav25jQ4drhffrUHRV39U7pr6lOnBKdnScpb2PUPoFP/ZhyDT0= 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 OS3PR01MB9639.jpnprd01.prod.outlook.com (2603:1096:604:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug 2024 04:23:25 +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.7849.014; Fri, 9 Aug 2024 04:23:25 +0000 Message-ID: <87ttfu729u.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 8/9] fbdev: omapfb: 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 In-Reply-To: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> References: <875xsa8gws.wl-kuninori.morimoto.gx@renesas.com> Date: Fri, 9 Aug 2024 04:23:25 +0000 X-ClientProxiedBy: TYCP286CA0099.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b4::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9639:EE_ X-MS-Office365-Filtering-Correlation-Id: a6d344b1-1e6e-4100-12a4-08dcb82b0349 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; AR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VqrGuIQkL5BnP1zemPc7qpj7ZEiWXhBv+MyOj2XSdUAi8COcY9T4udqpde/Zc6e/Ergu7t1yu9lboPIkpCnt0/sVIRnxFaxGeaDv34jXgLbkchV0+wh5YxJ6cgTvUIaPV5T0FCjhPlwd3vSTc5VzNV0pLE31iyPI9L2av+RZe2ilBZpmBGSg7lWod1TC/1tQZi0hQGK96otU/9MWLApWs5Z+z4aKwgID2/idsrltyxz8lP+gIEgJd4JHx4pvaYFEIE0WfTq60nuytLuq6D+8A7qr4/kOWv6W1S6Pf5pkxJeljqvAnBcFmtYZy9XSe9eGgFzaAVTlgXjwVoreaRANdRsn2scNx+PzbJIqOMAnQV0PBsJ/tyHXfN7ey925Zi8Pb1X4L7x95BUPjoi+UHuo1u5cZ/HdUhErj+bTA9FyJOQDCCsa/k= 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:(13230040)(52116014)(7416014)(1800799024)(376014)(366016)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a1nDOUIozb4HP8H4qpodupMG8Cz81wXtg61yXq4ti5ZZjgdzF278aWw0aLkBxNSpVxLgbRE4wE430VKgg7cuQgfhMsHl1Hkk+gxvzjmRd+OU4kAwzdzlp2JGUJFfqjoHWOQcg/rYKdIH8afNjSV6yhKD0c5nXxmhblFyed2KXZrxnL4FQpCbjQpz4WwynUWWfLnBmqPgLF/qHK1OjUyaknbq6LvxKamVkR79+lN0MkQ1cqiyGpsSUc8esKS25H06rz3HBbfpaOBzrbMIrNrf/jg7fFDuEWN+P4c7hwzr/CCaHHWqITTi6u8t0vsAdAHC7ADXEEHBZ8WQA21en+tweJJGpNxJIsutRVBhmtG2fgSG4HBRE4dKl/1FVQP60fLYXw+qAOPZ1zJigVrIMl64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enzdhhSxpNuFHpqfVP1zMre8uQ8afxRCIT3Va49vEHGgPfXMp0VndoAStvpTjNIbE7xMvZDNsNdEwDW5fAZmffggTxRH72ZDGvZTzBROJgA+BG9gwrDphU/t6d5gNVlAEg0dSYYaUuJVSZsoXUASldDKTIIyNKOOl7+mn4QRk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6d344b1-1e6e-4100-12a4-08dcb82b0349 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:23:25.9005 (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: FPxlLvGOmbq9AhV4dbWxotOYBoaeQSdkVc6WxERNvqzY6M3lBnP8ch3Zj+TQGgRDgYR4KI0RadKeX8IvvAieOFrWbxQK33qKLrTtc1VjaJDJHG/cHwyRERobtOibDoSE X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9639 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now we can use new port related functions for port parsing. Use it. Signed-off-by: Kuninori Morimoto --- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 3 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 66 ------------------- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 9 +-- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 +- include/video/omapfb_dss.h | 8 --- 5 files changed, 9 insertions(+), 80 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 7c1b7d89389a..395b1139a5ae 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port) if (!dpi) return -ENOMEM; - ep = omapdss_of_get_next_endpoint(port, NULL); + ep = of_graph_get_next_port_endpoint(port, 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 4040e247e026..efb7d2e4ce85 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -15,72 +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) -{ - struct device_node *ep = NULL; - - if (!parent) - return NULL; - - do { - ep = of_get_next_child(parent, prev); - if (!ep) - return NULL; - prev = ep; - } while (!of_node_name_eq(ep, "endpoint")); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint); - struct device_node *dss_of_port_get_parent_device(struct device_node *port) { struct device_node *np; 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/drivers/video/fbdev/omap2/omapfb/dss/sdi.c b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c index d527931b2b16..22a6243d7abf 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/sdi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/sdi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include