From patchwork Thu Sep 26 00:00:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13812669 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 DDDA0CCFA0A for ; Thu, 26 Sep 2024 00:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Date: Content-Type:References:In-Reply-To:To:Subject:From:Message-ID:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DHgw6GC5axbivs2dQKRUpOp7ZjZ23MoMVhFLEtfLidc=; b=Hx1mTWQVuUgsT44xlCa5iHzGkz 3EcLzP+ci5LKG2TDavFdWjFIzn20W4hyu6cNiVUlErJFVO7/H+CXw4/7OqLWlzBltS86FWamMFLwQ mmQDElSTfU05RGn1uxDfZjzOoib4cuhFAwKDOqYOSzUlcvhdWEVi34YkEZFkqdK1fuvb0PfOL7Hz6 Dx5GGM+ScVYrD+PAzdmN4IVmfpzVCWho+bsX34aYhwDuanq3cLl6YhcfmdAmqckQJs38p9U3ns6Ru 5BXYjL5MpXZUKo1p2FCJ7ViKxJ26PhE2srb8bTkUEVrA+8AqA98ZXsxOcMHurCmSVo9Dr4R2454Qa 5N5xmp+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stc5q-00000006q4X-3LVw; Thu, 26 Sep 2024 00:10:51 +0000 Received: from mail-japanwestazlp170100001.outbound.protection.outlook.com ([2a01:111:f403:c406::1] helo=OS0P286CU011.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stbwM-00000006ou5-2rfc for linux-arm-kernel@lists.infradead.org; Thu, 26 Sep 2024 00:01:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=We4fH0NaDwx+JLYbzLnRL2KvBrJJrHWIMg0piBwz/cxfBN2HDxRyMbNrEnx60vf7fYtkwjlagdzTzc9wvbb3ZPQ6JW6gQmomUaUobCQMWi57VSn9d/QoFDgtImD9MCWBvNbudkkR1i42IgASckeL9bPuvVj2xaPRXLGuumPwH+Y5xtJ/NMzsWnisSs4/tba+ZD1pA+xIiW4/BA0G8tOTOKjRV018UpU/D/Mg6fdbSDlDh1Obd9BKHIy/Cn/nY0YAqu4yNPvbM+Z82aMgV4rsQx5ouLln2eUBRtc86dKEtTtJRtCHAQ3YLqFlsmwyKAf91pIG6rH1wn0hvmM+Gsxvdg== 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=DHgw6GC5axbivs2dQKRUpOp7ZjZ23MoMVhFLEtfLidc=; b=ZZO/wnDMYb7gYWFL96MVSAQvM7YwWuva/HM4VSitNq7A823iSqNA5Iia53I+Ftgzmg9MaH1Cqw5WSYwNOAmUOOMze/zpf8vBxZP97LbUEJqDt9V0glppLbQUFQw4MrtypyKG9DOA76dtQu7kp6RSUYFTokXU0LeVi+s9D20uAhTUurY9TENgkoSo6WXzZJZzQIzKEgc3orkYQAsiEP88nGpPIVFtxQdEODkRTKkflDwrK9RFwAFrwPycw+MkeSzyD9p0TWzhmZ4OJBXWVEWjFFaSAxdX66fEu+M6lRic8J1qOCkG6fOV7hHsPZVKrrkvKZy0fhHoUdiWThYlMua9dA== 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=DHgw6GC5axbivs2dQKRUpOp7ZjZ23MoMVhFLEtfLidc=; b=SKPPIrg/7nIKr4rXPtuyfC+VMnej6Nr9MiEYSdlOtY6LK2NUPE3LhmCKCYBtacG754AFfuIJlwVnKQ+893Hp4j2CWkI5lds3uXPABkKX3P9BRiyoHrux2OsttjsPbEpoFxKfxDdnwGk4XfyGpsDwIHksXDoWPgx0/gfi8HLMt1E= 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 TYWPR01MB7353.jpnprd01.prod.outlook.com (2603:1096:400:c6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.20; Thu, 26 Sep 2024 00:00:57 +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.8005.017; Thu, 26 Sep 2024 00:00:57 +0000 Message-ID: <87v7yj8err.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v6 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, Sakari Ailus In-Reply-To: <877caz9tdw.wl-kuninori.morimoto.gx@renesas.com> References: <877caz9tdw.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 26 Sep 2024 00:00:56 +0000 X-ClientProxiedBy: TYWP286CA0018.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB7353:EE_ X-MS-Office365-Filtering-Correlation-Id: 413bf290-18e0-4108-9ee7-08dcddbe4c22 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|1800799024|7416014|52116014|376014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: H4q1AeKSsf7tsqQlojcq/ps3XqvTFzJh8PgO9qYlQFg2qD7aSmWBNBfGKB7RQ3N/Wxcic5afepLKxkFm9eIs97XvVdqPvwJ3Sr1Eoter8p5wIeWPjp0Pm8wEacmbd5JAwP7+/jlHhOihU0OroArojWQHWk6Inf3M9Zk28TeWqoeZsxrrdsulDL0YxxfUuaQc96UMCC89hUm9HwYYAGT5RQq6JjktnEUnTdnzuoOxIwclyUHWQJyXFN1xzeejcZTQRjZYv9UKkDgo+hbQDtRE7Szd+a0CFOKrxXC831mMxmEC99ZICYPZKmq4+eyxksAtV0vOoI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LVGagODtZj3g/D+Gyt9xsCK5MHxidam6S/GlKwwu63I+EyM= 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)(1800799024)(7416014)(52116014)(376014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5hwo+WpRS7mDP1AUBPIP3SEM0ADBEqBzD+hD5dMfvULK2mSsgCjft3KBr319xh1kxS7CWbdGPDp3Ut72M8zfb+L72scH8xjFo5f0DJ1ppISNYTvVVkZIoWJE4ZX0frzapnFqNPqoHGbQBY+yp2L3xfXomjdYyXZxnaWJdMRcra1ZjQfTRi5B8jn3w00rnf5TgsD8snrM+bEFrBIeLmsa49S+7D8/9u6ccaPHRriQ+xTDeA+hun7HzeUTsPHZ82zVlk1vPIhqM8UVPn7d1NDZuOO2SstcxvHpUBZpky+8euGuLHeqwqBMkb4i0uTfgT8XsITbrCtTqlRiDeN15PB5OgP6SgWkML7o5uIV5FnGFlxjyhQ/Nf110XRlXrcC//gyMSekBAADFZgR+kvBDTPlc3TCW9bRHCbxngexYGJBgs9KC41QVFVWUzN274hC0j4nrvizYlg6XwSYbNE9WWxhZbwz3o9YcOQThRjZ5ed48F8gXQDDyJLgolMyuI4OneK4Q3Qevnelp0KVFuwKCaGOyXzqR71LS+63XAOocV+9b3YwRcKHIC0hCi64iUNzb3o1LRKX65r6R+9ZaMuz4C3Ts7rM6mehJOTyq0mJKTKKEkfZ175J8PhjwUeSpaLPBuAL2GQeUlDJLSMyrlb5lKkEm7AQWdRX0qi6Yt6mW3xTT/MGGlezEAhrfibeGvI84ZAv31vhkEHgk2qniRTzXgLPUifDFPGA1kDxhu0734YouPq8IYWO9F+cyxboFFK6hNv3pNpwLdXnng13jj5T5Z7NkgyOOWVrQKKZfKpihj2nanlnFRymovF0fDpXHVPZ/Le/UeaiEGcCsd5X2OKFOWTdVaVG8MKqECH20Ut2GRDo6DhByCr0wAfZljyL0ITx31FZALrS0UjNwWqv8OKQkEkrGdHxImGx/A8kQHuj08sVz1btYVSRxQdWowpAh+Juy02pvO5BGH4k5OkVhZdbK9N3WODEGESO4lteK5BdI7oHUSpOmgiNPe0G1mkVdW746Vo/e9H+7e2CYW2IWugBGxRzBXAR8UOOs5llH7nlPDWtwHCxLZeewbgHMzDDb1z+AvYVkC2OkWd4Ed2W7NHHFqFiRrMLAONQpD0b+iLNrHmDKgp8O59455A2VAbxEZfsieszaWnPcKWb0AGqAASwtH/pKcfxI9P0VsF3NQ5glsFx9/iLv6hAxQI3fHsYYgAi4M6vYzTzG6b9uV3CAwx0AlQlUVXjFBxUVd0XBNLJhG08dSyRrBECWiktJ6l4TMZVZHXNkFB3B5MZMbiU9xkOIk8wsuqCLLfOCsfrVw9A3MrFKYoEu8HSJQiUAkCwIP0T20LWpj8wVE3znnPJS2XS4dGPpN1IRwRuJcJ4RKDAOtgKmao4jIMc9rCD77jtdZVkFlLFL/xwRJjECwNPuld+NJoU27DGdjcKSqqy58KA7Ib0917WkRH+jDjhc2qo/D7d+JS3Gny6rki5+NW0z2t+S3auMHX4ctBP+LbLfbjFhVUmDWrgotcIt+60dr/ZllQnpP8NPXXhQqugpK4X5R65Mf0TF0Roka0hEz3F4KOOdi/z8WjLi2Dq7QbRp2JBsQoYEE2VUvYVcAxu6OzDI4Ic779DQl1jlIfSBRic8p8XhTPu47M= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 413bf290-18e0-4108-9ee7-08dcddbe4c22 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2024 00:00:57.2412 (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: cy/faLtCqcMCtZpeqWHLQUPdd2ZCVrUBQd7rTSMCDUSUmEh2LRtWWY93PoTxCRcgSp/+97httCxsZ+jNEetToo+qB/fT10/n4VpwjPQvVKzax3Rfi5dAZpVJGBkSIuI/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB7353 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_170104_477687_F29A04E0 X-CRM114-Status: GOOD ( 17.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 | 20 +++--- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 +- include/video/omapfb_dss.h | 8 --- 5 files changed, 13 insertions(+), 87 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dpi.c b/drivers/video/fbdev/omap2/omapfb/dss/dpi.c index 7c1b7d89389aa..395b1139a5ae7 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 4040e247e026e..efb7d2e4ce85d 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 d814e4baa4b33..70bb35ef48b5b 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 @@ -919,10 +920,7 @@ static int dss_init_ports(struct platform_device *pdev) struct device_node *port; int r, ret = 0; - 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; @@ -952,8 +950,9 @@ static int dss_init_ports(struct platform_device *pdev) default: break; } - } while (!ret && - (port = omapdss_of_get_next_port(parent, port)) != NULL); + + port = of_graph_get_next_port(parent, port); + } while (!ret && port); if (ret) dss_uninit_ports(pdev); @@ -966,10 +965,7 @@ static void dss_uninit_ports(struct platform_device *pdev) struct device_node *parent = pdev->dev.of_node; struct device_node *port; - 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 +996,9 @@ static void dss_uninit_ports(struct platform_device *pdev) default: break; } - } while ((port = omapdss_of_get_next_port(parent, port)) != NULL); + + port = of_graph_get_next_port(parent, port); + } while (port); } 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 d527931b2b165..22a6243d7abfb 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