From patchwork Wed Feb 7 04:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13548099 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2065.outbound.protection.outlook.com [40.107.113.65]) (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 2C5D7125CC; Wed, 7 Feb 2024 04:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707280754; cv=fail; b=inVSwnqOILERzmbKGEozUXpHzdx9uAB0vItq3ia0IlsX0FJ0908/wfjSxPPrCUl9yQtGVB0cS7/j048w9m/dsRjpsRvl4mzWJn32CvpMPmjLm7e9ORiCtHudxW10CnwpfHQGeaNVfU1Tx3O/a0tjCCrtkSk1GfLQ7qracGZLZUM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707280754; c=relaxed/simple; bh=/H5xJxo3+eBZQS2HCSsmXz6ntcbSZFlOfBUGRn86mEc=; h=Message-ID:To:From:Subject:In-Reply-To:References:Content-Type: Date:MIME-Version; b=WxGs8kcX1vlkyvW+zk/63M7YR7WHfdP8Ccizv+EgcMZAoicE9jFZe3VetAu8hv92PCWZFfPlhC15OjmOQzuBt3zqzsBldc8Zekx4jj6onhYES3U8GthZR1I1fKJo0LDca8GxG2c7ozKTPlPYVDBRXzHuJcu2f4bNxYO3k3032XA= 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=l93jM7wT; arc=fail smtp.client-ip=40.107.113.65 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="l93jM7wT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vfq1ARk8Z5+PJRhQZHGVHVvqzy7s13p10G7Ss92+5ONLfujRJxSct+cQ5ykiMUa2GVXf66hCygUIsvdknI3olpi7qKkLe36hkMAmTKT9QOQsFvrTJG0/LJp4pLU5UZsyy55Zg4u0RkbCVW9kUC+Px+wIaFBoT6OA7R0Q6Ro4yT6tgVBtV0cE9gF/ZWLVp6Ed235GE196Zl3fImsTCaAnRTWcbeZMyjmL6KyspT7ffleYQGrRNhSs6INgZc4boObIV3ahZQLu5znkhTb6qLRuy4C9THh6XqyrYMRWnXIK0FRBRf0FsWS+3pXz6lLNi5HPFbgTzClzGpDCX7qdfk/5Mw== 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=lZO4Dz/GNHo1h09jBNGewKP5aTros4FOvOWP26VM/UB6in1fjCX1Ydzt04DcQ1oNOWsaU/fh8FdOLX1Y0fIIFgUKrLs2RKGc/ABHp2JXP2BVYr9A5aD3rSmvqZVGyY3MVjhIUIomDXsaflbsIa9pvwvYf6TEAPk4SmhEvjtCbTkGXQ/0m1jqaI/D14VnUnYM+g5+w83biBTjs6pxzdKS8Aq5WxGOk7tj46pW+KuXEydwUCQv1osw6JiTFOFMzKF8ieFNrrlMNOF0iSuFI4NpI3GJj4bv9vO9Vy2rgedx3omovxCWVNrOl6y1AnzdgYYEf4y149jVYC6153fcYoZUAw== 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=l93jM7wTF2zOE8TTd556QYt99eVQ3n2ES+gvDh1vespfIi5OHnjKfOFShMU/jupikKXayEhInajhApocMmnm7UvCk/JKe4TkEmGbVzumvAEGPJ/BfZXpJRnMFPdnHqVPLr4fu/vfCe46zpjwTt6qjcDVSDTV0A013Z4qvKerKQ8= 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 TYWPR01MB11031.jpnprd01.prod.outlook.com (2603:1096:400:398::9) 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:08 +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:08 +0000 Message-ID: <87msscsxar.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 3/4] media: platform: 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:08 +0000 X-ClientProxiedBy: TYCP301CA0048.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::17) 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_|TYWPR01MB11031:EE_ X-MS-Office365-Filtering-Correlation-Id: f349be94-96f9-4da1-f038-08dc2796b92e 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: n9NwH1vAjm0A7H+A7RaQVlgY7l38Wfr4bBws6+kSnFLF1dfcY+TVzL1BlCfcdbnmBizMmfz3tI7tz3e8t096MqPAk/ET4pfpSLwt12LqmnQq0oBJrBX1Mycmg8USG/9p4sAe5Ro0VwWiA6N48xu5uJIWXSQalED+ylV07tg1D+By44dbmouW2drdIJAbCvVoK042RkA/LyNDTF5mYVxj7NdNh3lWk16EVRikUK2/3Rme7uc6YZ0DFT1tucWD5EgbFsRJMPTVyljjemujlBjo+Mfko59HlYJsnZFSqpzK28er16Ren+7dXT3NaWbGHJBHJKEftqQTejKJ5m2MAeFR6gGCHavmErw7bX+YuTAhlqiBWPZzbVmwLT4nkAfKe0dre43m4HcwNBl8S6qLjNZY3mWARqYPITDCt3PFzbIXYB/c49oqlwJaWwd5SerNJLnw0087Oavmn1bwuRfM7aKFVRKubDPK8Kz7HNFaRO9cg7IGtTjVlN7GVMRvC0yM4LE8dQcxavBH9Qv6fPJAHJKte00i04b10FFquJ3O8lQvhY2d2GWJ9NjMYzKKg2CnAFfcv2OAQv9Jp64K6bb6g0g3JogGyEYT8xLaP7k6Y8C60X75h2/5yFawSfxANIfyF+mN 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)(136003)(396003)(376002)(39860400002)(366004)(346002)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(41300700001)(38100700002)(66556008)(6486002)(66946007)(52116002)(36756003)(66476007)(6512007)(6506007)(966005)(478600001)(8936002)(110136005)(8676002)(38350700005)(316002)(26005)(86362001)(2616005)(83380400001)(7416002)(7406005)(921011)(5660300002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RFE/dNmfzErAHBAAKAC/pFNwX2iCwdoPxYNv/pj8Qk/0/IGqria6sA4BHPCm7bAcY0RErjwbDLWU5K4qPogjPtd4ilgTa2f4TguwZ9/npcrccGMrjIOMtSPFT3wFXfLTncPYpe+DcBS8OktHOQi1/A2zau6ibZRO5bjzyL/tBmfbeU0es9MB2wEaiV7+RIsRFxQRrhb8tUHRnU8nj5vNpY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aegE0XBQkV3e64veSwCPGEH9/ZIORNWOPA25XlEUOFKir2SQtjaPBzGtYvVnUYbdliAdMXluA04OxgvWfmKgrz578y7hZoxTuxOgcs3TDW70f5Kl/GkavH1DXQnqM+I9uzhn9ZNKc5eLudFiTQ+5eR9H1l3fYZBQbX7r18rsP9pr3M9n7kYyL17MV6nEg53akzKm+03y1h1yJ2rcgtgoOcdN6QoaOu/uvDdGOBdeMc3iEzSOQAdgk3sYgE6OJLSxea5K0UxTrrvypLxOU265k5YXSrUxJdw/F2A/mD02ETNQdBDnXJxEdTTEhRpjogzcQpa2BRDU4VNjvAPRdFEFmgAJF5EOR3lXWil4oyO2Wl8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f349be94-96f9-4da1-f038-08dc2796b92e 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:08.6159 (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: q3Rxc9V2OMKCYUyLwFnZrx/DwGM0yCB2sxjpATGniPoQybu0GQe4p9rPfpumYj6rS0YFA/EiYkbQqnwjCOuTLvhKgmQ1syS3FHJh/Jp64FuVU/L019kEDFFSxxTjM4fs X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11031 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);