From patchwork Tue Feb 6 02:55: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: 13546559 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2138.outbound.protection.outlook.com [40.107.113.138]) (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 893307317C; Tue, 6 Feb 2024 02:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.138 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707188150; cv=fail; b=mV0wtbirVLkpfEWl7k5v2L3cWe9pVUtU0RIsPeZz2zjm/6bgcGI0yQexIzfr/ESYo3GnCzmzGWQfeVgWEC3IxI7hC8EsEqivQ4YEuNWv7QVm7nKQ3/798n1xPuwy9nwwujBA0zNd2bs77fbAwRWQhO8Tis8E6vpOs1m6mmRWmVs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707188150; c=relaxed/simple; bh=G0LsAI0oqPeauAZyA6OWja107yXlx4hDlNX/NYvbbQ8=; h=Message-ID:To:From:Subject:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ToQOGhUKCEPdHku/bvnZDcmRMjViPCnkLnT8ewBE30sONgFGWT5DyTujcJmIKhT0jUK9EkFMNZYXZmZBvLeQ2zysvcVewxLxAnOPMIK8mXS0dXE6i2SLB4ZDHIrLU7qAAT+M0tvqYXO9/3g2XmV1sAfzcGbRvK3c9eKEdRTPkm0= 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=EdmyIAWc; arc=fail smtp.client-ip=40.107.113.138 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="EdmyIAWc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fZp1vQ4BsU36v3BwF5l3GDZAalMfy2952qnG8QBZtZ4rXhsxTAuiNXfiIAscWjMJF73q6vbaO4xJuVZ8FhQr4NjEJaj5XqUgxUbeXATJqLmWajnPkhJ4KRWlE+of1BDPVjujrPB5Sdj5GKf82o84qnfM9Q6Bc7TkzWBFKXiWUkshv6qy6yQ4kgF4czM0V8wChNMqxKwzvw/r/60iJu5MopEXcV91H8cughAavGy7RQ9hIyG7I5u0By8kVHs56Iy/ItyKpFzjw4EIuP8/eDbwKoYKdQuPLaMq0pkQ18qDUmIhhVvoBvjTQBp4AxcXWCaraCmhPHPrkOPNJ8Wyg5Ecng== 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=dwao4mgd6zne6nju4+WqYJ/tYqJbRjF933+zKt305BQ=; b=KjR1yjetN8WSzp0Yo5348bXzJ36G2xlW17OS2TXxqCkI7ovxXvaxjtYWePh/q6f2QjiLRSIEiT5OLwjS6BdkFV75f4oJphktQd4l0rUvH8FbkjMZxf9FyRQvSA/fQQd0XO/QXCa2bGL0ir7NukSf4JCWEz3Pw5nKJFUTjYBYmuli1pLUB6YvIC3sthLthj0WEwq0JxSn6sEjE5Bsx6jWncBBaR96govSmw1Rc50cqsGs2aqvnR/Vo0hdiUoD/MobzrshsudpMHJA2igqyWja27bI5rhHYix+VWOV2Uvw4Ytyx9wrXNw8PR/aAiaUffx7B88EbdJlteqLFZLkK/0tPQ== 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=dwao4mgd6zne6nju4+WqYJ/tYqJbRjF933+zKt305BQ=; b=EdmyIAWc1V+DKpmjKo8xE+5OwtTIELlbX0ikORh/lUArYjUqSX4zk9lFHONEsBp33c9mkFyDBtDJ9W0EI831g8RNyXjXnz2aurD1ZS+Mg0/MrHPcckka/wZKj2ZHdMuhcbd94kvri9ZIBhesokZWQ1I6NzEGBPHP8kVXR+TlInQ= 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 OSZPR01MB6229.jpnprd01.prod.outlook.com (2603:1096:604:ea::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Tue, 6 Feb 2024 02:55:45 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::4d0b:6738:dc2b:51c8]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::4d0b:6738:dc2b:51c8%6]) with mapi id 15.20.7249.035; Tue, 6 Feb 2024 02:55:45 +0000 Message-ID: <87o7cunvwv.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , Biju Das , Broadcom internal kernel review list , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Eugen Hristev , Florian Fainelli , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jessica Zhang , Krzysztof Kozlowski , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Neil Armstrong , Nicolas Ferre , Russell King , Sakari Ailus , Sam Ravnborg , Sylwester Nawrocki , Thomas Zimmermann , Tim Harvey , 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-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com From: Kuninori Morimoto Subject: [PATCH 4/4] video: fbdev: replace of_graph_get_next_endpoint() In-Reply-To: <87ttmmnvzh.wl-kuninori.morimoto.gx@renesas.com> References: <87ttmmnvzh.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 6 Feb 2024 02:55:45 +0000 X-ClientProxiedBy: TYCP286CA0013.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:26c::20) 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_|OSZPR01MB6229:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d489229-5ff5-4a76-9b6b-08dc26bf1d61 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: S++4mPn++clG+pFGR0DnATtGuo+fjwusi67vT+tivWp2j/0523LzLYRLa477A8phmkQvikd8hdtOoyMF4oNQHrETPFgxYvUC15yhXUsHCncHpfZkMBKgW9TcecLS0rxJaZm8JViyVTvteG4dBjZ7kzwAVqPPlT6yBTgj0K7Q7JefiwGXSjkKIWINDgsuM8zyrehUXGxYwHrg6NuJayXI7hsIKz8rHwFITNILqCuGchX66cSEUE//nqrueHbPGgbF1aRjQTMMKUOJWrYq5iFDQ475ttoCf/zvS57eKVScj8O/oO153S0txrImlYEfUW8to0R4JOR4ZChioQ9xwC7ZdL8YT4lA5VZrGXAaPvCo6shptuokZCSxY5S+O1aXHxNqEeTsImWN7TUF7KIDSsRE+ucq4PqWRMNTg17aWyPJeEVmPdbesdZDGum21PfpX0kvx5otoC2zPsIo+n9sWfVnL4GsaczCsHj2R3hEJso7OgCreWHErK0YPo5BFajeNZlc4j80jnWy5wLCRHku/Rhqo6H/koDMPfIxyPZtdacofrP0OoZeq4IjvIGPnSZdELZ/w8Kfq3oaAXDTvwPxHL1eFTHq8Xz3APwxhfHpYcj+16lYj/YjkuhCWTGycI3Qn7mU 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)(366004)(376002)(136003)(346002)(396003)(39860400002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(38100700002)(52116002)(6506007)(316002)(83380400001)(26005)(86362001)(2616005)(41300700001)(8676002)(8936002)(6512007)(36756003)(921011)(2906002)(478600001)(6486002)(966005)(7416002)(7406005)(5660300002)(66556008)(66946007)(66476007)(38350700005)(110136005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8/DyDToJ0X8YYfX5tHB4iguLuGFAjiPTyivWvfVh84a8VDWD366WJVRiQmkKrNil8r7rAGANG93O2lNKEc44h970SXk6fGANpqMZU+exMd2Z1Z1BmoHcTeWPG7552uE7ptS9oas5KJjq17532EmnzhmTbdtYV7b/d+7X+W0JqXfimQyAqRMTtxvLYMQvtGDQaW1JTtAHz6Q0/19KD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NVGfpMxx4/SMZ9OcmSCP7aVljX7JotODTo9blmLuToWeK6DRfVFTNJB6VEJqzAK2jp36QVw9985BAAXRBBPVk2RtyiJQkZsXNvCfPdrzSvJj441lHAItyiZVx4LeSdLBNykfFGv4cVaZoFIdMnN8XqtDGMlpOuPz8G/8JKZIErLZ2UzRMBLOu9HF4IXpnyHqgkMY94StPuivGCIR43EDRwcNoOOC0yDXQA1/RMniampkPHyyIbsStbrLeyyft5BrkCwsI5UcHry0CzbWJfQAmq8hQwJvD1WfhTHkd7lbBSUJinx12lMGeOog55GOVtBqsJZFoOfNbaSmtqYOC3MDCYVqE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d489229-5ff5-4a76-9b6b-08dc26bf1d61 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2024 02:55:45.4737 (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: cEicr3Py2OkIdi0H/2E/mQDUa6zW2q7DB/m8GbOKPWr/jezflWziAPWNeHc4hNPqbFK15qADkSTuLdxchqcMsV1HfzqupSNKGtjTvay7gFxPxHRxfUNIsKs5EmrvNULe X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6229 From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org Signed-off-by: Kuninori Morimoto Reviewed-by: Laurent Pinchart --- drivers/video/fbdev/amba-clcd.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------ drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 3 ++- drivers/video/fbdev/pxafb.c | 2 +- include/video/omapfb_dss.h | 3 --- 8 files changed, 11 insertions(+), 28 deletions(-) diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 0399db369e70..2371b204cfd2 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -691,7 +691,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) /* * Fetch the panel endpoint. */ - endpoint = of_graph_get_next_endpoint(fb->dev->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(fb->dev->dev.of_node, 0, -1); if (!endpoint) return -ENODEV; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index b7eb17a16ec4..1f13bcf73da5 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev) struct device_node *ep; struct omap_dsi_pin_config pin_cfg; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_endpoint_by_regs(node, 0, -1); 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 0282d4eef139..14965a3fd05b 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -130,24 +130,6 @@ static struct device_node *omapdss_of_get_remote_port(const struct device_node * return np; } -struct device_node * -omapdss_of_get_first_endpoint(const struct device_node *parent) -{ - struct device_node *port, *ep; - - port = omapdss_of_get_next_port(parent, NULL); - - if (!port) - return NULL; - - ep = omapdss_of_get_next_endpoint(port, NULL); - - of_node_put(port); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint); - struct omap_dss_device * omapdss_of_find_source_for_first_ep(struct device_node *node) { @@ -155,7 +137,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node) struct device_node *src_port; struct omap_dss_device *src; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!ep) return ERR_PTR(-EINVAL); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index f05b4e35a842..8f407ec134dc 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include