From patchwork Wed Feb 7 04:39:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13548101 Received: from JPN01-TYC-obe.outbound.protection.outlook.com (mail-tycjpn01on2063.outbound.protection.outlook.com [40.107.114.63]) (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 0970D12E63; Wed, 7 Feb 2024 04:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.114.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707280807; cv=fail; b=tjk92AZxdFVHeJMIRe1hDXufgIMhFeQNfhXbFzPtycdJVKIYUZlcam0H45eFANakL9loP0MqGNq9uHpZTi4EIC1C9Om7aRMaM6si6WEtUIYKJhdwLw5VWGD1V7eIb6DPK6Du4/B5lAEm0lRAfZHmkfZzaUBdpS/jtRfFXkbLv6k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707280807; c=relaxed/simple; bh=ACJsB3c3uRSOq7fiK0+Topl1ll+h4vxSHGo6LRKP5ac=; h=Message-ID:To:From:Subject:In-Reply-To:References:Content-Type: Date:MIME-Version; b=g8MBH/piqge7MDlvfU4ki0GQM7cbCVWfT2VxDCwDdPgcPbp0Fq2ogrlcyHSh0G8EWmeZHlDjqe2v6zZpsV7QhkwHPB2+VpXcbi6v51rhuFjJKvH8qCGoo3FQcuN6bXA/kFmwlcFbX5S/5dBNrQhTHK9GgypUx0G04qpDNNUQ2Ns= 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=Xa2Ta4NK; arc=fail smtp.client-ip=40.107.114.63 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="Xa2Ta4NK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuLEPCHTUmDlVDKQIqjR033xrSUfD6vLl/M7QgH4x2wlcQfJQ2dsJuPr/yFGtGizu0W2Zf3nJ4BeoV3uMpJ+iS/m4o8SISX5NGqMsp57rkrtIKDtkCvKlBHFneo9WppIn47vZYatXslgim7mDDDKim8Ye9gaXNFpnSsZfs2f9QnMcSAPnzO/4Sy8BTpbDLeTwJ+eakAsUcZsx3krCOVUJMXh7pHri/CZMGBZYHraRDz5/Ozpp5xcIc2yYhGc//Fk46LiGzg7UVCC201Rq5niU0SL37q0nA+FNHa61fd95rsIxwvpf5z5C5tg4pBXWRh1nnyxHNzSKw/QT0d3TuEx4A== 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=jWuUqo4G0Oo4K6U/5Vsb3mSu6jH2NiwPub5J3ALk494MIdWN1xM5hBRxTjpnQNJVIIKqvMAOBZGH1QgPIbpT3DGQ1lyqIPJ/AINcxvLgxz1ZeUp+XN8LAjwqS/tIGHJlfbCE7kw0TfXyIXhjb6I9g84WABOGcGEpQW5055jVXvoAzUCBy8VBN1gWkvavKG97U4CgUbjWdZC6ZCI4MbB86cyu+ifGLNNW2N56oqw2HphVCpW82DsoIZkolxibeCFkpK3jt6/5ubUvz+W/3LWBLW69UhKLxN+67+v8HAHIX0Cii7egeD1M0XrxqSJ2kpE4vVSsiIQIFEJyhAVzyvExSw== 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=Xa2Ta4NKc8lwIimc97EPwgbASu3wtTLqqZrNsbeCkoX2H1W5NKfNlTIE3dBQOWSVtP66B5w73hUNJThHgtJFIzidE8gzQEcyldOfkkBA3hn5nK25kZ4/ljbwh8mRDZL0vM1CVQ+x6xHnOfev1cu9fLQJ0SZPnJK5V259f+QYmbM= 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 TYYPR01MB8022.jpnprd01.prod.outlook.com (2603:1096:400:f8::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Wed, 7 Feb 2024 04:39:01 +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; Wed, 7 Feb 2024 04:39:01 +0000 Message-ID: <87o7cssxay.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 From: Kuninori Morimoto Subject: [PATCH v2 2/4] media: i2c: replace of_graph_get_next_endpoint() In-Reply-To: <87r0hosxc3.wl-kuninori.morimoto.gx@renesas.com> References: <87r0hosxc3.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 7 Feb 2024 04:39:01 +0000 X-ClientProxiedBy: TYAPR03CA0021.apcprd03.prod.outlook.com (2603:1096:404:14::33) 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_|TYYPR01MB8022:EE_ X-MS-Office365-Filtering-Correlation-Id: b732614c-c7f9-42e1-a6e1-08dc2796b52b 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: BsvH+XHCwT7QmyZ+957XGgZpj29DGoh45Gi/j4ZuG5W8y/fD9XOZPlAtpFVxHY9xXeCNkDmocSP4wDxF1aNM02aMZMiAJ2rRKco2JhCO/kr5er70ZVplUblBvtdh0YzFi4P9xHxjUN5MGdf8lsnUb7EfJ2TV0eGlb7PU1sSZ3iKv278uRzZSsV9j4N/3x+KJAeS9dkkKoeAbFoUTCyYIj+h7JeXhU2QnCA5LJkJh2ATGBjBIk/f8hSRHMRGK0YD2ot6c04sc4TKvUBIugDbUl7YC3ssVzN9hOLft6wU7fKAkh5XIXZ5pTyINnomAdRdSuVUS+63SKa0JkfI/yzWuCHzqGIoDNJYaLT0V5tOAMsx5L048y2HOU8jhlXsrtlnDMDepts6upFGPZcONePoz8U0M2fVm7ZLWsEnVvYhVekGAGKu9vZVcU5Zj4xqYxSpYgK4vXVfue0eM8xBzp9nJZCfm1Ce7k2dQLAMRQCTE0Kk5d0OwLWzRJiZGF6K/jtn3w8airwt512gX5uxfFuBdDKqTTi38OMd95NRwZ5F8ZXup3tBsPtPFOJvACxmkMgvIVoGn2BJhyzd46TDMqnmgz0N823ik6VFrMdFI3UFjxzchWMeB5ArQRrQ5WqYfBWB2AirO3/6nvLQRiHq2eNJX5Ej0f3aB08CAIgfhk3W9i8A= 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)(39860400002)(136003)(346002)(396003)(376002)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(6512007)(6486002)(41300700001)(66946007)(66556008)(66476007)(38350700005)(316002)(26005)(8676002)(8936002)(86362001)(6506007)(83380400001)(2616005)(52116002)(110136005)(36756003)(478600001)(966005)(7416002)(2906002)(5660300002)(921011)(7406005)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: apwHb5LisBtty1Hb1k58GulSRYfc4Wv8q7DG3KGfUymuKn1jbMb61V4Bi/kY4fYisJFSAqY8jtIESYIQkgCNmn29AINP6SGkjmii6adQDsUDO407sE0i9hUCxdBIRjFxOodvHTe9UvVQ6Qbcq0uUYZ0FguZcYYnvtOuYf9j9bSOA4H9pmSU50OYocrN7nkroiPFM44FEuSnMI3jqnGuqgg6r+NsSv8MeUFmReA3hK+f82T385FD1BM0pf69FNQID+4AKFdKyTzqmtJ/hAc0MbbxyWg9zqaJnS2IOJXpGnZPBA8cLOM5WA5ZbVmkMJA/7q5/cyc8+uUx0gGZtW3k6PEfZ7ewMN0ZpcMqaTC9/JXBBqMbxI+of1okTn288ITP/s8j+G6FVMpInECTskB1TMIJuMiugsE89vin+RRANrfYc/xlsHukUmP21z7CFv79Rwdp+fd6+FPstEzhdoreOjEyy0DVAy49MAz11W/GHcfNvPJvSum45q1Ob9w0sfJdv93XJJICh/W2tOy6W23Q3nGSNznY3m6frGIoVfxiAuSicGOkYrLgj+xf5ALzTuc7CvSPjKt9GNcLJyQEiXBCSpvU6a6WLqEplTg+hTSmxe7QPWYNz611pjQIJZY5hsZ8Qo6F7lMeewFxmETUnfl8l/XkpP9n+j/p1bFIBFQv1OJCm7chx5C9Bz6N3/8VuLMBDDPkMkaCyOm3hn07yrKBbKrUAi2zYrlgmdSlS4rTVkW7u6f+cVUmY6DSeTyIXEjD1TqX3/DFUmMiTgH4YuvXK2OFuNX+Ayw3OcBdOKZfdDHE/U3XriGH8L5uokch6oc2fQj0Xa/mGfdb8Tn6QcokB31+VBGNjxBFOB+A/iXQ4g164MGtH4K9yOeHskpM2YwdsaFX1piwdrtpdYXVJ7yxhk1ptsP2m+ywzMZivpsBDN7XuhBR4SeHm+0/RRmKgHySOJ0buIV5xwyQ79i0NmeWgOmVq5/rphzwsrGh7IW2T+QtRwOJ+reXarlLCdJyGTKOqokUiHOmXnba3Encvn7OxtoWX+CT7rYeBIDdzqvUfR8KzQTyn8dhrnYRARtWdSYV/L3k1tnHPRNinkBv8B7H2D+aK17Z+R4RwqzMT+Crlj11w1wofYVoGmSNI/ya2crnTnU7SgDffXp3eIz4uvcw0EZk+ErdUXWqvtcpjH6xDWrlvug7odmh/t0RpOtNt13URfxJwEHvq4yfsuH8KMhvm0msasyBUMns+/34IkygI1VUflXVeQpPBV7b1QEWqFxB7WTUmj2oIrQPjFHTQVfywnwooJ1LCOpX/MTDHkw9Zdjizf+5MxnAqpv778Z3oSQ4oNecPhxXY3EcdAMXK4yAYnQ+ggP2SlqUa+A06paRa5JuIq/uT6AzNBUJ/YbNUgyB41h5ar8sYqPcN+5mwXiyZDZuHE0ZR9OMY2pEMirwbOa2z47B+xSYcCnmOz4t0+s6G3uNrC9pjirAaayFDudkq9XcRCYmLTtIgF5kARhjvO9QnLEu7BrArf2k6ZH4Yk0sKmM12YlG36OxzGKCQjE511AS52jfoPAN4TlY9mDrwa41g5ypQadzJhz9axUecw9J5UNn3xhlK0CJ0MnyH63I6gBYv159MzznIgPkYz5qrb94= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b732614c-c7f9-42e1-a6e1-08dc2796b52b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 04:39:01.8820 (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: Uth2EA+pgGVKY/We9lkJyyKutlW6ohwJ02DymlA3zSjToKBNeo1uENmENI0djONXaFsbsfNvszZ+4L02Qc11ubAhTdnhy30x90JTAbAR0QRWzYpEohqqUxribmVsehwt X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB8022 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;