From patchwork Tue Feb 20 01:16:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13563241 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2058.outbound.protection.outlook.com [40.107.113.58]) (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 5169923BC; Tue, 20 Feb 2024 01:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391769; cv=fail; b=DLKE9Pq5Wm3Q6R9vlOmNvdrZa0/6Y8kO+cDp6kfFjzQeLEiYe+/NHpN0YsccMoYmdhusbHKZMWj21gbnZ/zDNjM07EblQsgyxoCH+6wY5CcGBKX1mziIvqj2epUm3VjlVvqWrOWB5p3wKHi84ilX6K+5kDNMOsGPUbV0GWl8V1I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391769; c=relaxed/simple; bh=PBx3L/n694IQdZjtag+8/+Ruoe7fNeo2Ye6oAKrPhtc=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=cD/yhWlx73o5ZXLyXcKxfFyFoFA1p8hDb9KLxbzUfghH3qXpvOW7Sy9qishUvakxq+o0WOsSvSTwdyn23PRvQALVUsEWnQPVl5JXeAyj3GcSCO1R/LFL8LiBbsVbyo9/CfAcCe/4nmx+qkyAA6qUYbCY4X0ipl7Yybc8xSVQID8= 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=iRJK4Snc; arc=fail smtp.client-ip=40.107.113.58 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="iRJK4Snc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b5DmcTJp5NkBv1wohjc+aaWMGCqqZHg7j5gxGc3G8takDrCg4Ybwrop5I7QUXhf3EHd58dC1O7G6YUcvjOQHStQ05ALzo0EgYaas4+8EmGuRNK6dk7QVKpt4ELniMCSN9+oFVqnZ7GCBAcOukKsbL3V+DbHGEtB4mRqxQtdbmu6ZOEHIOOcDzOp56DKSI/ifEEWSi8bHfLdlF4pxtSuWW+Q9ZdWB4X74UbNrcDTo6pCUrFKgLse/U1pkwwFjFTMaYg2ZC50WolRo7CbBr4w56miEMwwVU1PH27QirJN/Av6KrUJ/HEXSuBPsTSwhajEkhN6MsTepO41TibTse0cjnQ== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=bOphjlt/HKYZdCXr34UzKPMPPUJcMgh3yZynjECB6L8n43qWbJ/Suh2bgXPCxwqL2D4tsToWCf7YJXO8kNgJuYgGEl+wIIIl4zgTYNqkkY4yMEYAgLSHDrgR55GJKfaqUWnOMwq6MIkFmoJSMPhUwJ6bXTeHWxwyixyxeI6Np6Hr6tBYcI/kT2M3sxWnPsnCQpf0okW2nmD0rZwM6g+6tmE/5PRHKnzOtkF5YwdBuGMXHiyd/q7UiQO07+BL78X1W1Z0QYU6lRz6aAh9R+S9VKbuaJsW2s4qc8gvqJeiAUcnsx3vjcRfGOpIAHt+TQakJw+EKvoEqcJEUEUIkIWAUw== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=iRJK4Snc5SYwo400Zi78xXlBy3VUOtyyVbWJVyyEoOcHOo8CClj7SKrA7RSWpow4vhCNCIrOelVm4qgRLRBY0O+NVjtJ1ujZvYEDpwNF4oSYtaIA2w8ePgn9cA34gE/rlAiy6rdKWJ3bHUCQh+WCevU9FCcGZpzDk2fb/NKM7Eo= 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 TYCPR01MB10730.jpnprd01.prod.outlook.com (2603:1096:400:296::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 01:16:02 +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.7292.029; Tue, 20 Feb 2024 01:16:02 +0000 Message-ID: <8734tokka5.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , 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 , 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 In-Reply-To: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> References: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 resend 1/4] gpu: drm: replace of_graph_get_next_endpoint() Date: Tue, 20 Feb 2024 01:16:02 +0000 X-ClientProxiedBy: TYCP286CA0034.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29d::11) 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_|TYCPR01MB10730:EE_ X-MS-Office365-Filtering-Correlation-Id: 94f87b4d-115c-4c58-64ba-08dc31b18132 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: 67tGbR+XhqbX6F4DY4HIf4xavfmDkCJ3IJIMfod5FpTPyGvScz/SERz6X+xUisA8nKt2LGP9rCHNMUA50YGuyx/dhIw2KK7m1APskpZzJI2M7T5mB6GECaXlg/aNeH3tSJMuY4vqZ9ptiu0bVS8cG3zhxCg8R6jB+Vwqd5kasBqvHVSbvJ2Du8El9HhMRFREI1Wpg8pKBv5nB784KT/9CVA+fEULjq9P6P9vRSUyPKW7zQZSJz0aAuVMSu0bZLXmckD6LqQgAkdP0ETcF6wr096MtPbAFo5jCn/vhGZmFO9Errqwb2VIjMbPcfi3dA/lnoJAqZ0gL7Yp0uawf0BjwS+YLgG8MZMe54V00CyVAPX0OOpl7D4EoFA/o1yBYgIDuLz3TTwsaKB5jbYdN1ZprrVmfOQGLyr29O45abjzVnOhkVizqyB80SLIxth/xnr1BgjmMRZvTT6GJ95yA3SX7CD47+JOWgENjvJZCiPtYImSp4xdMBrEgYTL0s0WdDVyQHBjZi1nZKjX+HFmLmha8Csa514cR/qxEzSEY2FPQlzQDg7twPbISQaU/ZZcJYEx9h1isyUlE1K94u5CPZA+EaGr0DfxxG1f2LClkCV3+FyY5wo8CsCWINaLNEFPUY6Q 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)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RAD3oyrXNH535fk665NeZDQ8a7UyfxANp+hKHYPVvYejEE7wQxtbV7UjcPuiuN+3Tp3kN5l5IaKuHEtHaTwJ0NI4jG91CSXatBZE/QzIYuQJcKVBwAnbmvGw9qyUvVPIM19cpaItW9ESfpRSKzpBkg9xzOnv1BpQvOlTbm8DyIOrwgpQEKLiW1SXDAqxneCcnqGSM5kCrv5gIun6zZfac/XRE0v6RDPeDd6sYCdBBggaZL3adO8K4Pr8WQXMDRApNmkvoCTMVFa1V2G9qUNU59gyHhAnuJ1nAK/i4Y7uH9SVCvZQ0/DSVe8dRBTXcW8eg6thFMT9kEoZmTU5UG4XPfgTE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2/pTqEJChJxYotmTS4AzwgWQLr7zgg0938farZgFePV9pne+J+3VUwNrFX5MI7EY+txGHY3OgZ5r6a3tFoNCyfVMlcwqd2TFXlEsGl4CPzojw1ltm+Yr4xs7xtKAu4F3mglQuO8dHuC0+n/fPzuj3YlVnGWd2bm7ygDFa1UC1csYfZu04IUfe6d32ZqGmK/y/sbiMklSEYzRFC/QoCoXldEfmQM6F9SciQ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94f87b4d-115c-4c58-64ba-08dc31b18132 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 01:16:02.7478 (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: lWHHQlxn2px78pSgjaEOKVG27BRHh847O3QuSpJR7wgPwB/k3n3j6cqNeAzNbVmbA24O+e7Tem180MhAt9k7KZqNAT5Iq1KqACdTVrbayHw9d0mDMRG2MuViCpdUBICW X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10730 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/gpu/drm/drm_of.c | 4 +++- drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 177b600895d3..b6b2cade69ae 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -504,6 +504,8 @@ EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count_ep); * Gets parent DSI bus for a DSI device controlled through a bus other * than MIPI-DCS (SPI, I2C, etc.) using the Device Tree. * + * This function assumes that the device's port@0 is the DSI input. + * * Returns pointer to mipi_dsi_host if successful, -EINVAL if the * request is unsupported, -EPROBE_DEFER if the DSI host is found but * not available, or -ENODEV otherwise. @@ -516,7 +518,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev) /* * Get first endpoint child from device. */ - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) return ERR_PTR(-ENODEV); diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 4618c892cdd6..e10e469aa7a6 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c) rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); /* Look up the DSI host. It needs to probe before we do. */ - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) return -ENODEV; diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 4f8f3172379e..8c29b719ea62 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -288,7 +288,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu) * There is only one output port inside each device. It is linked with * encoder endpoint. */ - endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL); + endpoint_node = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1); if (endpoint_node) { encoder_node = of_graph_get_remote_port_parent(endpoint_node); of_node_put(endpoint_node); From patchwork Tue Feb 20 01:16:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13563242 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2040.outbound.protection.outlook.com [40.107.113.40]) (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 0B24B168AB; Tue, 20 Feb 2024 01:16:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391787; cv=fail; b=A6IAZiGtfjmAoMOWu9EU2WJXW0DzhuXyE3aHC/Kwtjf0R+uitCXDFdPoKruViLWmF2d9YPjPe+W+tLe+EicaXm84vRfSaCb+XfhN3VzV5EDXsMyoPeqbb89MXIUNhAihikEkSfHriAkdCpAgAz+y1KzzQMgS7Y4ejlghJznjVdo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391787; c=relaxed/simple; bh=ACJsB3c3uRSOq7fiK0+Topl1ll+h4vxSHGo6LRKP5ac=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=BXLV81VtIAMiFYZ/dAueh7KFUm4Rw21zjPWKpRvDA0UpjzpoMH19uX9qm3UKr4Hx/CmSzWP2aasaydTJvXIOCuRIJeAMjjj7Kbb/9B1B/GL657Ee225UvElyJxn6xI0j18dLWkK9Un/M93OeWUla1jpUjzphjvP1hO81moET0qc= 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=YhRd8sPz; arc=fail smtp.client-ip=40.107.113.40 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="YhRd8sPz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k9kwTEE1DCnjV6Q3Cqc8HZIarRZt4VzpYlMCZKkFgTU5KnqMVNtN6S4Me14LScmE9C3OEBOgRwkHA8466xhTbp/qDNEplL/TCt/BO2iaZGd82JXRMoohYfyuCs53yEPCedRCOa53YVjQse1+M4am6rVUqer+rwvggyG0XNl4eS3PDYWXbpGaxJgUQZxKK5J5lcqTaCgm+hJDBkhVh2yinGByxd+XLnRhljUeFKo7QU/iLraKn963orQb5v6Q446s2ygIl4c69vUazp9H2QFW1+48D8Ujx1HheB2BKsM64BmdT7rA+hWDlEZPcB84devDQH059asNPTiScqx9Xkizlg== 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=o7lQcPCnpEicxp36lyHMSuSuqJ+WxW2JpXlU2FrAGS8=; b=Ch8og6o7lzGG4NF59n1pchYpehpu+UOVX6YNQJf1zDA31b53fAHfdixpwLvDxmQnyeTO5QTTqhkWry/7WHubTW4wdyU5APcGNMy6pMPHvHUOsKI4y5E2KJbnjOHkFh7jHKYYd+lYI1d5/8ju9oO727usAoin4BqEIbMyKDIVEV3xoWSXKdYuEGcVQzxtUaE7Jb+zl7awesGQKIQR6xPgMWiqtNUnahBJFTS3SbYg1ug+lBHvCYxV8NnU3jUOTogFh4e/gvp3w3rKIvyKOfPopaBjiO2WiLW8DhmHOleyOqY01vxZW8SiUH2Y6sygJYv8/VRIkszy6d9a8jgFzjdQvQ== 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=o7lQcPCnpEicxp36lyHMSuSuqJ+WxW2JpXlU2FrAGS8=; b=YhRd8sPzYARE6V3YiySA+dDS42qUsnQuuqX+Bga10Tr/0HBwBhUI5XatGyTKUHl+lcgLXy6VHRG8X137eKUOYZgSBEfNBkAxp+zb6DWKOSsoRv9uOK1VtdxrOppiMGh9rblOmh+1cPjxLZcRhVrfIv7fnIrEG8FRt+nXtlQdhSA= 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 TYCPR01MB10730.jpnprd01.prod.outlook.com (2603:1096:400:296::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 01:16:21 +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.7292.029; Tue, 20 Feb 2024 01:16:21 +0000 Message-ID: <871q98kk9m.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , 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 , 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 In-Reply-To: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> References: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 resend 2/4] media: i2c: replace of_graph_get_next_endpoint() Date: Tue, 20 Feb 2024 01:16:21 +0000 X-ClientProxiedBy: TYCP286CA0334.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::12) 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_|TYCPR01MB10730:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b3f2ac5-f0ea-41e5-d4c5-08dc31b18c7c 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: lgL1Mkw6zGLSdeMpQ1KC9RT62i4MXcYnqXqAWzU0VvTDnFlj49dMBAw4OOMS3xSK8MfIKUTjIFjNWsIK0BsPhaghivWoh0PwbZejfSlQSRRoQBNJJ0If8fddMl7nMIbp5ASck1QBRCpJd1aQIBFCRuyf8YoX1cqIvcaMErcZRVqX+Ti/xvvThq6z8oXaVJ5cmUkIKRQaEvQfW69Duu88M3HLmyaros5+d3j4uo1jfIXAfXFMSWtjP22tUCZqmNJ8MoCG+j/ZUpdx5pV80Wx0BnKnrko0EvfnIyqG26PHRoHcxhm2ksVWn8U8vNUowFAMhxGbrnHf/NPpVca3qURpGN/d3ygOkPAqW3KiuGby9vxgliQbX/n8ZfF+pTmjuUup8nVKOiMjgaTtZn7OAQUrBQWDAUfVYFMPsCfR+UYc2GKeFyrqm/qbkwdpW7qmg3xD8pfAbPuL6kXD82kvpoK+2B8ddobuzSWBDncDm/bL/ZFIWdFDP5Og/spXdWsSRQwlrulwRu5tAwoR2+5TU9jiuTg1ONUWffPksTFtfeANuxwi+ibei2Gv20eI6vUM0aLIBtGECo5N1pvtryDIdizc/Bea7X1AfLQGn560gtWjQte4fhXBJEPDodJKT4rvoO/H 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)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xgr70iuoPHML9wJZ6u0YxeKxF6ezAuFvVTgJ5+kQG6wFUzodPhmZpKwvcWdqMsEGCpwhV6VK3SdWAxj1JkvcCJj5F+z5Q0MTN9pfeAFsBv6R12igNx9yCuF+QOUXVy3lK1Nhcsgmm/b3OSJGU6vyiWfkkWtqt82fguxmzqzTfW9nxUlg3WwA7sGELcux7Xp7NskByVPCvRfrDhFvBOFBLgl/1589JxKz0ZiFOH8LfxyY1slLAWcDNQbabcVZLF8ROf85k4+HHLhI3xzcJiC2EK8e84ie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Ox0MGfkHdx04w3EWaQO/MWSX5CR4ssmu8g8shs25xGZ0v+v2qQGWbIGXvvLYrCSbIH92EKm9K9jJYHYIUQOywqlVMQW9SIq3AVtvPuJd1qFCjce561W0WNt55YR8nmPCNT4CEu+HrXH4+7O34EyltSYyv7T+f4DHP3JkAUh1EVSJRSRLViUps+AHFnN/LZvO5EEasSQG8lxi3IX4eOLz/Gr5zaagvWV/N5by1AUCkTSMNRSEDjPeIjub6W0TPTD+Ranhd+pLfQhRijK/ukUOc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b3f2ac5-f0ea-41e5-d4c5-08dc31b18c7c X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 01:16:21.6682 (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: nFlkXyma6O4KGBqbKn2apHRSgZuxGoO8G4mBzm2sMSdlzy2yL5cETvSMoRCHsskc+Ildw9xzynlymMbLMW0KNDDryenzVuFjvYrPf/kZI6udd8N40onIEqKBfposQdv2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10730 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 Link: https://lore.kernel.org/r/9d1e99b0-892d-4a72-a9b3-886b8ed094b0@xs4all.nl Signed-off-by: Kuninori Morimoto --- drivers/media/i2c/adv7343.c | 2 +- drivers/media/i2c/adv7604.c | 4 ++-- drivers/media/i2c/mt9p031.c | 2 +- drivers/media/i2c/mt9v032.c | 2 +- drivers/media/i2c/ov2659.c | 2 +- drivers/media/i2c/ov5645.c | 2 +- drivers/media/i2c/ov5647.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +- drivers/media/i2c/s5k5baf.c | 2 +- drivers/media/i2c/tc358743.c | 2 +- drivers/media/i2c/tda1997x.c | 2 +- drivers/media/i2c/tvp514x.c | 2 +- drivers/media/i2c/tvp7002.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c index ff21cd4744d3..4fbe4e18570e 100644 --- a/drivers/media/i2c/adv7343.c +++ b/drivers/media/i2c/adv7343.c @@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - np = of_graph_get_next_endpoint(client->dev.of_node, NULL); + np = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!np) return NULL; diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 810fa8826f30..319db3e847c4 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -3204,8 +3204,8 @@ static int adv76xx_parse_dt(struct adv76xx_state *state) np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node; - /* Parse the endpoint. */ - endpoint = of_graph_get_next_endpoint(np, NULL); + /* FIXME: Parse the endpoint. */ + endpoint = of_graph_get_endpoint_by_regs(np, -1, -1); if (!endpoint) return -EINVAL; diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index 596200d0248c..f4b481212356 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c @@ -1078,7 +1078,7 @@ mt9p031_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - np = of_graph_get_next_endpoint(client->dev.of_node, NULL); + np = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!np) return NULL; diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c index 3ca76eeae7ff..e9f5c6647f97 100644 --- a/drivers/media/i2c/mt9v032.c +++ b/drivers/media/i2c/mt9v032.c @@ -1006,7 +1006,7 @@ mt9v032_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - np = of_graph_get_next_endpoint(client->dev.of_node, NULL); + np = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!np) return NULL; diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c index 1d0ef72a6403..d1653d7431d0 100644 --- a/drivers/media/i2c/ov2659.c +++ b/drivers/media/i2c/ov2659.c @@ -1388,7 +1388,7 @@ ov2659_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!endpoint) return NULL; diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index a26ac11c989d..9daf06ffedf4 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1056,7 +1056,7 @@ static int ov5645_probe(struct i2c_client *client) ov5645->i2c_client = client; ov5645->dev = dev; - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) { dev_err(dev, "endpoint node not found\n"); return -EINVAL; diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c index 96c0fd4ff5ab..7e1ecdf2485f 100644 --- a/drivers/media/i2c/ov5647.c +++ b/drivers/media/i2c/ov5647.c @@ -1363,7 +1363,7 @@ static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np) struct device_node *ep; int ret; - ep = of_graph_get_next_endpoint(np, NULL); + ep = of_graph_get_endpoint_by_regs(np, 0, -1); if (!ep) return -EINVAL; diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c index af8d01f78c32..cf6be509af33 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c @@ -1568,7 +1568,7 @@ static int s5c73m3_get_dt_data(struct s5c73m3 *state) "failed to request gpio S5C73M3_RST\n"); gpiod_set_consumer_name(state->reset, "S5C73M3_RST"); - node_ep = of_graph_get_next_endpoint(node, NULL); + node_ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!node_ep) { dev_warn(dev, "no endpoint defined for node: %pOF\n", node); return 0; diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index de079d2c9282..6b11039c3579 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -1849,7 +1849,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev) state->mclk_frequency); } - node_ep = of_graph_get_next_endpoint(node, NULL); + node_ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!node_ep) { dev_err(dev, "no endpoint defined at node %pOF\n", node); return -EINVAL; diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 2785935da497..872e802cdfbe 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1895,7 +1895,7 @@ static int tc358743_probe_of(struct tc358743_state *state) return dev_err_probe(dev, PTR_ERR(refclk), "failed to get refclk\n"); - ep = of_graph_get_next_endpoint(dev->of_node, NULL); + ep = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!ep) { dev_err(dev, "missing endpoint node\n"); return -EINVAL; diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 1ea703a9909f..8e4a0718c4b6 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2310,7 +2310,7 @@ static int tda1997x_parse_dt(struct tda1997x_state *state) pdata->vidout_sel_de = DE_FREF_SEL_DE_VHREF; np = state->client->dev.of_node; - ep = of_graph_get_next_endpoint(np, NULL); + ep = of_graph_get_endpoint_by_regs(np, 0, -1); if (!ep) return -EINVAL; diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index 5a561e5bf659..f9c9c80c33ac 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c @@ -987,7 +987,7 @@ tvp514x_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!endpoint) return NULL; diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index 30831b4b56d6..6a04ffae5343 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c @@ -893,7 +893,7 @@ tvp7002_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!endpoint) return NULL; From patchwork Tue Feb 20 01:16:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13563243 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2060.outbound.protection.outlook.com [40.107.113.60]) (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 1AF52DDB6; Tue, 20 Feb 2024 01:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391802; cv=fail; b=raqYhJGweJ6ujoJvKt8cGrkPcbbSfCax3+ZzVx6Mao6FRBXZzEGAyqY6SC+a43u35VFItunt79eu5dbSPUoQLScP3IzRdkJksVyVYPaWfAz54CQRxPcZpm7OL2ZvxSWzlPYT0GmH9JMbqVmeWeZycrm4BcjHh/V2z0WfCoJ/b+M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391802; c=relaxed/simple; bh=/H5xJxo3+eBZQS2HCSsmXz6ntcbSZFlOfBUGRn86mEc=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=IvB2d/y1QsA5thcQILGC5NpHJwxAcuzvaZuh8fF6YtweMKopd1lUuytKXgzAK2TNUxLNIlranYJceigLnFjusGfbHhZQG6zHU737Xh5wPEq/48XEhmBM+koM6MEZqBoCM16dwyiMvWRnvIWadmtAaHpKOac9S6s6bp3bKZPm0Sw= 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=AXDSURw7; arc=fail smtp.client-ip=40.107.113.60 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="AXDSURw7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nu76xaqvmn0ODlyWVnxFB98fJANvLgTg4WpTIgDkXaYFQCW+tb2/ZEck4Uwa2CeYIoDBAWMSIbpt5W4uD1N7RRPiLrbYn596sBwLwc9+NWweR1/GS7ECafKpZeCNdhLi9AHDxtM8xUTKNyGUp9IOiF/BObMr8jI3DE7ej67mrIvOH2245ZMTFOGSUbhUJAlc6oZ2hlBC6KYwwPOorDJIcaTx8g/rnb/8XDHIdDqdOOl2kLvajP8DgO12cq1lrLSnl186BIf7MSjFLDvZAMLo22fEt+g5rfFLb+I15+E5L+qguCmtqx3V2TNkFv7NuXEBB3nwhg8y5S7G4QYaaNGlbw== 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=YXY+gyUBLqHr5OVGylRo6rD1OZwlsUDCqOi/+/20yMc=; b=kDddt4IKhhUEHS6Wd5CwlZXbsK+2stZRsm2yROWdfYgGHz35FxV0kMrrzefbU/HaC8Tl7P6v+pJYS0ztGnlQP6K4O40Cdu8Rx+udiNTOgskLNZG8RtFsv7aYPloJDffhGinSeu3yqMXLPy/+JY9fxEQCLOGVrSA/PP5VlOV9XeJBk6CTjaRM+p/ZcZ2BTIV11eQDjBQqyZHnjZ1lGQKnBcNKt4oVEIU16ya+5VO4yOuRepLeTY1xkQmHGFRlOmSRU6e70FG/t+68rZM8tNZXtdcqAQCODJJBUSmDMO/KGxMvPby8ZUlgWvxYX7LzMD+BpJUJpwfJCJLhK1utkmflqQ== 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=YXY+gyUBLqHr5OVGylRo6rD1OZwlsUDCqOi/+/20yMc=; b=AXDSURw7BpQWA58c7yijNx1W97UShzmlJ5qiNCUQljEfthcA9X1+a//PIp46jQ2nnDtPbbpD4uMujDrX79dO3+Y+cT0DKx5UCdFDsMyuvZLeApQndKoCduoQueVkQ/tcbTW/UZ2PBJlVVGS+5Cw1JF8BGMyh65D8tFTB6vRZaW4= 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 TYCPR01MB10730.jpnprd01.prod.outlook.com (2603:1096:400:296::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 01:16:37 +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.7292.029; Tue, 20 Feb 2024 01:16:36 +0000 Message-ID: <87zfvwj5or.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , 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 , 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 In-Reply-To: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> References: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 resend 3/4] media: platform: replace of_graph_get_next_endpoint() Date: Tue, 20 Feb 2024 01:16:36 +0000 X-ClientProxiedBy: TYAPR01CA0219.jpnprd01.prod.outlook.com (2603:1096:404:11e::15) 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_|TYCPR01MB10730:EE_ X-MS-Office365-Filtering-Correlation-Id: 09785c7e-d90e-4eab-da73-08dc31b1956e 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: XyX8Vj39WSBrWDekv1iBDVn2O4QmYeaoGKhmmWGLA9XUepJKe3/zNcYHowc+SNohdxoGuD8XrKCAqAZLRDNIQSsfHGLoAZ8WWG5hii45gKFu5QrYUZNYiFOh0c+9gp8eahaWcVeOu/CptK+P/BYKIgTNzftGWFqavIomYHzsRD8rL7TsuO2f7q2wkbOrbZ9HxbGjvLEPyXhiDCCeRnB0ymKp18+5cuomrrfKuGFHhFphyCb64d0PnpnYvhQ/2Fb+CAnduURB8/h3JaG1JAZNd5BpVJnJZJfXP+H4fcR8dFy3uOTTrvQRWAPzPVzW6pVQiCsRgc6lwuHEZ17FeFhE7hCZl3xVpNLuu8m+RgK7bs1HFvAWrjTmAFLUK7IstxmCrpMlNXNvLgS1C6A7Vl6dwW9LcU1NGbj6B/9ExFzItmsqalWfn/IuAL2DQ6p0wQTXzuGKKCinOfMIthZAvNv67x4yVEgDX+hVjL1tIZulpYXpSRJCm5LuILTQEHG+ZswVm42iTxjQl3rsQhHuPfxrUaFMS+32Gvy/XkJgYWOucM+qzZ6HBGcsGcAKGNqGS519rgq89+SXcHQbv3QO8JpUqfVfQf88bSWkWBdoWZBrMAX0mXbeqKAEUdEEgK7D1d8Q 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)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EQen0pXYuKbw8ar2F1vxih6oNJYqi0Bt+TKEHYISzT28twme0i4d9xs+JMnkPRuWnO/Ql/Y+xEI0hy3xk+ratPAY1CLsNTxSHunEJq8QtruQjYH5xCm8ks+1NONf1o5EeMpIbBmaF2OHwtJ2iwjTLo9mkuCa86CqTXJjgbBieogUQs9aY26EFzDlWQgX7qzKJWdXyXO3sIdZeai+0WFgcKeUV5YvuBJGPLJdGaGAwAZSELZXJW2T2/Zi+hsRotu3jZzWGeRmMjxv85hwlsOmHR1Q6a7nopDMHzDzpQ4f/qhTEN5GCkPbEJ3JPTMLv/pnfinB8Y+4Qo1FlnGNUzxG88V/glIuf8yBJ7xOmKz9WMmaNw8+MBqYbCyK8EP1B3An+oFBau4BIIa137aBashYUaQ0jp/IJLV/dqa9oK3SEJuf/p1ko160GUJryK05DJ2sIrD6vXkOH9C3KhNiA3pYgKAkaWIQJR509A9Dl2W39HUyoKLmXOx8Rvbbo1QmJmjx8FE3lxotIAiUHEV5BcPA5lgYoEqi40FQ6+nzlZcMlm/+xA6y9zYiJgWsJmu8GRY0NEt2aOKk1ZsToj4+3QL9b6T1EqJvhqrNN+6R+pX9I/iUM10eZupeFD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c31b1956e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 01:16:36.7130 (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: 5ihPOVs/53s6b4jSW+/8BQGj4Av4JB7BnD0SXAYYMBDTiwaV1OzfRyEfpdcq3/p8Ro7fLY4RvonscC0tW0F+UPimvEBnjwco+eMbAgwVD9ywtkhdIYa7ocGeSDRlzcun X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10730 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 --- drivers/media/platform/atmel/atmel-isi.c | 4 ++-- drivers/media/platform/intel/pxa_camera.c | 2 +- drivers/media/platform/samsung/exynos4-is/fimc-is.c | 2 +- drivers/media/platform/samsung/exynos4-is/mipi-csis.c | 3 ++- drivers/media/platform/st/stm32/stm32-dcmi.c | 4 ++-- drivers/media/platform/ti/davinci/vpif.c | 3 +-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index f8450a8ccda6..c1108df72dd5 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -834,7 +834,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi, isi->pdata.full_mode = 1; isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL; - np = of_graph_get_next_endpoint(np, NULL); + np = of_graph_get_endpoint_by_regs(np, 0, -1); if (!np) { dev_err(&pdev->dev, "Could not find the endpoint\n"); return -EINVAL; @@ -1158,7 +1158,7 @@ static int isi_graph_init(struct atmel_isi *isi) struct device_node *ep; int ret; - ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL); + ep = of_graph_get_endpoint_by_regs(isi->dev->of_node, 0, -1); if (!ep) return -EINVAL; diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c index 59b89e421dc2..d904952bf00e 100644 --- a/drivers/media/platform/intel/pxa_camera.c +++ b/drivers/media/platform/intel/pxa_camera.c @@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev, pcdev->mclk = mclk_rate; } - np = of_graph_get_next_endpoint(np, NULL); + np = of_graph_get_endpoint_by_regs(np, 0, -1); if (!np) { dev_err(dev, "could not find endpoint\n"); return -EINVAL; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c index a08c87ef6e2d..39aab667910d 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c @@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index, return -EINVAL; } - ep = of_graph_get_next_endpoint(node, NULL); + ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!ep) return -ENXIO; diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c index aae8a8b2c0f4..4b9b20ba3504 100644 --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c @@ -727,7 +727,8 @@ static int s5pcsis_parse_dt(struct platform_device *pdev, &state->max_num_lanes)) return -EINVAL; - node = of_graph_get_next_endpoint(node, NULL); + /* from port@3 or port@4 */ + node = of_graph_get_endpoint_by_regs(node, -1, -1); if (!node) { dev_err(&pdev->dev, "No port node at %pOF\n", pdev->dev.of_node); diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c index c4610e305546..ff3331af9406 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmi.c +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c @@ -1855,7 +1855,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi) struct device_node *ep; int ret; - ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL); + ep = of_graph_get_endpoint_by_regs(dcmi->dev->of_node, 0, -1); if (!ep) { dev_err(dcmi->dev, "Failed to get next endpoint\n"); return -EINVAL; @@ -1907,7 +1907,7 @@ static int dcmi_probe(struct platform_device *pdev) "Could not get reset control\n"); /* Get bus characteristics from devicetree */ - np = of_graph_get_next_endpoint(np, NULL); + np = of_graph_get_endpoint_by_regs(np, 0, -1); if (!np) { dev_err(&pdev->dev, "Could not find the endpoint\n"); return -ENODEV; diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c index 63cdfed37bc9..f4e1fa76bf37 100644 --- a/drivers/media/platform/ti/davinci/vpif.c +++ b/drivers/media/platform/ti/davinci/vpif.c @@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev) * so their devices need to be registered manually here * for their legacy platform_drivers to work. */ - endpoint = of_graph_get_next_endpoint(pdev->dev.of_node, - endpoint); + endpoint = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1); if (!endpoint) return 0; of_node_put(endpoint); From patchwork Tue Feb 20 01:16:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13563244 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2050.outbound.protection.outlook.com [40.107.113.50]) (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 E98D6DDB6; Tue, 20 Feb 2024 01:16:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391818; cv=fail; b=bIV9A3hy6iobMhj9JgJyOhtPYxx1toOKIk+hq/kqFL/RVBOtwyF0DCrZNvnPypGoWqlO25bNvpD47WlmlpeJHy1fF4Wyp1Sya6K0jNg7McLMIVVMhVQLh2MEEtLAswu3jhEEl3EE+7T3Alhy6LSA/pdZhjwkT5hRgOdYtDLbyuA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708391818; c=relaxed/simple; bh=9D0tmht+UC/To/BNPPRfPIWvJEuU7lMpnpfq5DQo1rc=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=hATZdsl619uQeHs7iO9jYvSSG9hmK35L4cJ56hz/53QndJzUI4jdDOb7hPHMBmTeQGkxF+xehurEITCSD/keFp1iufAlZVcc5jddz/c4TC73qEgXhtzZKV3x+/xylEkZKfdrwEBzxgTURN3VAIWs9CDWkYopDwwwMn8KWGj1a1c= 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=bZsFAB9H; arc=fail smtp.client-ip=40.107.113.50 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="bZsFAB9H" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kOG2MPU0O1OqZeG/7nnUp3QEZEZo5oh6A46OPvLEu+FnAuISLwY2Ah9Zb+LT0fYy9SOW2oKNGb4wiaRqzgJQBnxFv0+kFL/qHyvdC3vkhfNUJJusLskB20qZRKY2o9zi9z6Z7NwcHm6CrjNQVEEgkVuB8vqlK/o8/qEMvW1JTlfHDA5UPeGeLX3MZ4FEiEqLro6bVIEkd7bbQM2wEQ1t+GZWn/JG/PQiVpHLUY1oiboCH78H+ZC4ffPWY8SxNW8WhBM5rRTMZdWOPyby9s6L1AYa7Lx8ypxj+D8ATBgyScw7gZUIE4gfmRAXRi4JJmE16vIh7vL6tzJ7kOKs8g0TIA== 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=iPWy+PYtnAvN+6i0I6jsdtewufqRlqn7Qxjn1KjTnik=; b=A/rjfCIWT7XVsWXV9kGqeLzCSxz7JQZ1Lzv9T7sH5CAqepvZNw/MzLsx2Yg6N7kD7HlR+BOh46/4eBWcP1qUk4xExGNK11mpbBBh0vqRL0lRZGc6PIf5KgPMaGiLF59hEy5dsQS6DXZ/vVXxXHvBG9udAKTFd2kALUpSvWIZLANHLWj6OOIPejZOCXcir4Do1OFpr2BQAK3ELGqwNps3xECUhWWBezk9LrAVFKdiCqpiWUeHdh8ADTV5LxcxfGa0ZUGp04ZKMM+TnwMGIc4FHtNu38yptzcOOHPPui8OZBOn0oIfzbL0RVsJ/43knX1Jp8IbbGhPN23s5+pvX+aNPQ== 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=iPWy+PYtnAvN+6i0I6jsdtewufqRlqn7Qxjn1KjTnik=; b=bZsFAB9HebwFwqY2K5fALKhoSGEgyd8Z0pqss/3FvibP1fp4VXEd/wefD8t24SgU8Bzj3Nnv+oyd81GRcxQAqyn0i79qaB28dbwHKSkdYLGLsfzJqnxYH9SiFkAGhNIxmbLIdU5IEDVh4ewNndY5zlGL14rZcGulnWKInqoY80A= 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 TYCPR01MB10730.jpnprd01.prod.outlook.com (2603:1096:400:296::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 01:16:52 +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.7292.029; Tue, 20 Feb 2024 01:16:52 +0000 Message-ID: <87y1bgj5oc.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , 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 , 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 In-Reply-To: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> References: <874je4kkdn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v2 resend 4/4] video: fbdev: replace of_graph_get_next_endpoint() Date: Tue, 20 Feb 2024 01:16:52 +0000 X-ClientProxiedBy: TYCP286CA0092.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b4::10) 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_|TYCPR01MB10730:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d26bfcf-b8c6-486a-3238-08dc31b19ed7 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: 9Hd1cP0a9uANPQ8rFQ2g2Z4kIf8YS5a4L4DcvdTkvKh7YLP7P11ISDCgrQdSG6rXvVirh16T+pCsaEecF3wEJXf3utcJjugux+YaPWHBe5pkR8pmZew/mG4dg4lgWGScQvg8mvi8Ef+KsoniKE3D799AqZCjHuOrRsmmVCZaMsJDQgu16DaaIXtdbgaAFQk9ko6vKpmamHvIEhVHWnkx79mKunuOx7X329DeR/PluYUd2oV5/2CGrDuUjjNawVVfN44lm+1q8mFHYsDb8G8ECfucRhQZ6UG+DtE7R8MRFj6dTRsEjaza7oQ0c7Z+7DEC9cMkOg2qCYAL8dQvSoKm/32W9TbbaoNgumWOt3EFW7bMEswAz1DZyLqOrhv56lxsz25aimkln0o3VXJ3Zm+tAE0ES3QY9iaSY90QN3yCDZDWZtBVwzd4XMkURJZhOMs9PEFPSHEa3ToVIxFWVZR4TnkxjkwfniAZxbvmNk40bW4Pg9jh9yAXhuopqLgRf/O0+D6A30HEgxhiy7lGSeJvbLhZNVnt4YXHGfVwCYdNpwQm2ci2Xjao6dFoq761AA2go0xp6SlHxbTOw/m37w3KtPRgCJfPNgy1iMdngxKuPiPDB+wW740/FfiI4AxG1ug9 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)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i+ckKuOPcvWCQI/6LCEN7ITVi1XKEIpX/DLWvvIppzL4uZRWFsNDsfB6GEYC2/VqNmGiMI8HgLDzfCnK1QDjBykI9XkY86ptXmBE9EafiBZV5krtKQvhJ7wwZhIw9SAUHvHwo2E2u0uO999C5T6BmS6ulwaP59XQALstIATSEXdbTUQ0QutK7+WNbAs2BVzMJ/YvF8lf2231Cu+CAkIVk6BRSvRytP3zH4uBHjxTjL571O+wTa2L7ZL/+6H7fUplt61BBHFte+2V20Y6So7vAR+dTsMQtFFAxIZySbJTKmErTgW0t4RCOtJqz/P4riNqXPG4tHMlty7ylGx2Vnvri2GYk2kyYkN3CMtnTTl8KcY7WdSxulVTjlmpy7Qru2wfXA/0h/UfW2+OIttG8QVSJgsywavDDp2UlidyfKtW5cQNk29uRSWhLK+IAXG+JMUdiIiQJi/EZ8satX3b8yMaLJMKE5UT4/Qbom0tUN/MmJ7uDJ2e7EonY2NOYDRpOZKFrKIZqjz0uoxcjF/7rwr0n2KLj4mNUFE54X7X7duanHAnu2py1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-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d26bfcf-b8c6-486a-3238-08dc31b19ed7 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 01:16:52.4622 (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: pF7DmZqmBHqrSoAGLtmP6zeXzb239ACwWPV0Y0A8GEo8yaRPG49ECNbhenuBTmYzhvhItej97nqAn3voWAGT/jtLlQ+aDZGRGPKnl80AjI1Tv+Ql/7gCgit0+PpdlxkW X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB10730 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/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 --- 7 files changed, 10 insertions(+), 27 deletions(-) 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