From patchwork Wed Sep 4 06:11:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 825375 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010002.outbound.protection.outlook.com [52.101.228.2]) (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 74DF0126C11; Wed, 4 Sep 2024 06:11:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.2 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725430310; cv=fail; b=fZXhOyf4UbIIb6WPgy57igDClqRLcuXoOj9AAdFhGW0e3xpm8sr7OGjA+KKxeuhR95x4Xz71f2wfInfRfjd4dL+faJGSpLMVgNUUqWdojD2I4nSr7vPOwNvyzs5qhaIveKi+w9dFrMFVZJMNZvkr1U7OuTKLZD5oQ6AfvIMkoh4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725430310; c=relaxed/simple; bh=OmA8vXAKwBy54uKFcAfXneI74zVRfIYvgdSfkXcQXUE=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=BLswGiKWaLe8XAXnoU/W6qRd0ejOjJ3eDjqTmF091T+v2HaJaM4PSz1Bt2gqaRXF1MqbFg05cvocs5gv6aZXAasogSONdojuRRm64Nalk9+/WamUyuGivs71AJGzCuznTTxdK515U7jYH8PnrzIqsOQsoziSxRsnb8yrdhKJt40= 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=O5Ex6H31; arc=fail smtp.client-ip=52.101.228.2 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="O5Ex6H31" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Go0e5Uu++1VIuLPIGHFzAfxZcgr43tqrWdTEitSRBEfvLHc2NzM51WzCimxmen/xQRXUoxepCUAigy2urCvHrK//U4n6fe4j2JXvLMDWnA8OYo1M2v0eei+Q4sh/Tz79WrtD1LuUKzXIAevv48o0/lveIZnort1ZYNwVvfN32lJUzGh7V3dnWt90Pym2ga4A7air4VDhLguegEGJYHlviyFDiRJy/W/WX94dR7NJI+7sXP9T2QiSMvtmY11phy8BHhB1P/Y8Y9jW0i4k/jIb596F/jB2K18dm0aUzkeX9LV26iUSoqYnMuoG+qJkUjkgn/YhUnJsz0zSy2kKjiXafg== 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=X+8dq8hvf2u19+2peNsA8CdWmlRAVdaYHFoKOHHojqc=; b=kI4uPJn7z9MCqiYnDF7bcI56PIVRIBJaNdUz8typCgicsr6Upfl4b68nA0zuN/w3IUG/uSPTqjmLISXhu6T2lV1FTaXUUAsAoVfOGroNfVwo6A/4hZRO6/jiQQFN3IO33nk2et8sNYqoetszoFj31AnB5nKEL7FbBu4fPNExelbTaqgvCP2eFdbYmhtWLsY/Y0lt9ijB+VAizX6buClKNxFiNBBm2Ci5PO6e8uXRX0abJh9dAPQtsGoMm2pT/reAZZGqlAdDoDJfjCzr0bdyuPt+TVH1lgugCsolk8JmUfpTzTmU5bV5TTQj7cfd3BItKsAqLhg5d++lqeeHvP4/Sw== 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=X+8dq8hvf2u19+2peNsA8CdWmlRAVdaYHFoKOHHojqc=; b=O5Ex6H31yg4Q5yzwOe0IMXIxFjARieRMPifyDTE7aBxQ2sO4QbD8svTipDSl8b1/ecXczazykHsxzG31hpUx4IdJuFek6s+/5A57LIgg7LiRpRLTSs7mRSj/SzkGu3GszMKyWnX2Msp3vwtEWCLgGW1phoTHxijHAYxgzuUr85Y= 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 OS3PR01MB7309.jpnprd01.prod.outlook.com (2603:1096:604:11e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.27; Wed, 4 Sep 2024 06:11:46 +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.7918.024; Wed, 4 Sep 2024 06:11:46 +0000 Message-ID: <87frqg6j8e.wl-kuninori.morimoto.gx@renesas.com> 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: <87r0a06ja1.wl-kuninori.morimoto.gx@renesas.com> References: <87r0a06ja1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 8/9] fbdev: omapfb: use new of_graph functions User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Wed, 4 Sep 2024 06:11:45 +0000 X-ClientProxiedBy: TYAPR01CA0119.jpnprd01.prod.outlook.com (2603:1096:404:2a::35) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB7309:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ffa656d-ae0a-4eea-e868-08dccca87475 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|7416014|921020|38350700014; X-Microsoft-Antispam-Message-Info: iApVnFvV5uBQoqm3AISGLi+FQlfV6IcAeSfcGRe79uAxxN5sScvqLJ7q2D3qUJc3WHiknqRPstpnBfxvIMDy1HT53xh7pQ6qGr9nC7zE2bY3egCvjRGlM4ejrpMQR8VPgR0/f757NBYwtlfEdypZypj25PdEFVHm4kNHnM2safvbIwSrNkIPpAYIZF4sz+nfR/j7tNu2DdTvPVlMVmSxWxt6HXgdjydnmk/4KRlz0EX4zt0l7PubvRs/4EOapfTL2E8GFmRAN1KHvMXWF/Zjo4YYw/9az9+A2n5sXbI0QDMAPAIIgunkowoDdG/Oce75XQ3w234EI6IzIOkeRpT1FoJ/GtSiZmBhGJpIYUFQbgsVJ4e1V4VY5OKxLMRe+hOvdWe73FC6bk0ihKoPfHEXs/0CiL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ANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oaikkWgyjGUwcmeqqzPUzrqdPbssWR98M0o4HqhuzPopEwLU7PAYU5POInlVMFX4TMqkJOHmu9EZOERS2FWYbUSE3Efz2MNXBmrMaC54nMcFswNOsCrb2wrLRdPIEZruWMd71vlcC36DhfgwOLvqlSAaspsJV/sh450MXBK1+dimMTix1zuJwImCFyNTFfrFFZeDR6LDa8P+6oO50LxcDBFwSeJamq4qWYFtgvpvU+14t5oSdyl3+h5HjuvJVA/Mknb3wvOagGnkQRwNX1dQDnnmre015M7SWhikTgMns0JXQlZoIVuFwBorc+NmFlunKPXLtHZUw9g4IHI61aeRvP2e5PPW7pLgAYzVQaOlU43+oZ8vwmKu67XSRX+odkbA1fOdwAfMwAPkV/GTjRY5r57OvQrv6Z7ccSrLyoCWg6ZFL72xII3kUUmV8XjKfUBzaIsgfKQ0QN9AfNuwG5FhQZwRwZP3MbzbAJaPwwNdIsi5VDolzs/NxRwHi3tZ1KHMwPbovxQEFRe7OYw+8bv1xG3h5mGS3nh4c4GbDell9GuvxIY27L2lJR30KPWGe+oq9DdBOqmTZt2uvJk1qDuQCLfBpcHGpZUsKeV9zNwgH8Dx0p6kuT/pJ4KT6Jy6UBKgoc74gbwB9Kp+dnJX+LIumcl0+NiFu0rGvl5o3m1A/6ad2YHFfB5ZZV4UD+MLDdM9HEIw+NXQXbALSC3alhmZRfetYKsRV4cV43+OWkmp2xfLp8/v9Rs2DdYroOAvIkHsV8lDpIKa4A9MO/qAHc0l0FSvuz3i3xjn3C+hVnkYeDRujyytaFuQc7OQtbG6KRQVCNqP5iWJXCvq4QeZYkWdORbCMCNQ/JlPWA5iz7891Vy75CheUlOSH8qI6pnWi4JaQhM8mPaukWPVgMqtOlnFljQTK1gf7esZ2JIhIVUwn+j7UJYAxu9Wk7oFUw/UBAnPeSmHh0QFWSqhTZ4EjGtJEKrO74BqBzpZ21jLz7hL+xCZLvOk2XLupAz5nZnmSzfh3jBjax1nGnxQpWGdVZfoMOha0uU1bwr2EQvzDy0+NVwW+ZyBBfnU4JnomOrj9GOahgTyfhERIhQMGqnSsIo8m2R+HYZbkogLb1ncRESYL91BeBv4KOWI4syOPaZwiBNrPxhREwaUAKJ09HfH/KcHxLzOrnQjhrQbwVyrMrwc+6wXTpSR14hxz60XI+BLOjApdMnlIm9XfUwsShYfvVYY6BAkuMYulrU3RWqodj84JE+6+Fl9CTodn9gHRrJY1JYdf65qPPD14zJr+teiMXEDWXPkgVFAcC2vNw8adt/eXE4+vygUDPwv2tE7lY6QwtEvA6Fsh+tvYbQJY2CJzjuOb0uxzqjRTsyZ+STgkHToCEferw/b6sUPMnBus7B/kOVp5QtjeBs20eUgb0SZzG1SwdmlJndAluY6JGX5KdiRSRLQJ/W6wljHk9WStxLTzA/ILUeczG0XO7HMoGmplOB310Wm8HBkfR+F6iw97+0zGZ7o/9msDCa4KhV4poQe64fmNtAgVUcjuaeBM9ApBouGh1XqAywapxwQSq7PrMfsmgNdbsb/YqojA+I4yvryG4xVF17bNZAcZl+xjlnMdBtJe20KLWg3s4VT9sjxcyehicQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ffa656d-ae0a-4eea-e868-08dccca87475 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 06:11:46.1282 (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: AxA24bmvrGnxdzWQYnB5NTCLlO1IFxhXImIxN3bUyZsClHGa2XQkHq23PesTPCncEieKG+/N2myXDg0Xwkpk72f135rn6MmdQlUfnDXpgF+QOTfp4hujUaIzIb32hrjM X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7309 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 | 15 ++--- drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 +- include/video/omapfb_dss.h | 8 --- 5 files changed, 9 insertions(+), 86 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..4b1c1cbb4a04c 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; @@ -953,7 +951,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)); if (ret) dss_uninit_ports(pdev); @@ -966,10 +964,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 +995,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)); } 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