From patchwork Mon Mar 25 02:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13601370 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11011008.outbound.protection.outlook.com [52.101.228.8]) (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 438EA44C86; Mon, 25 Mar 2024 02:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335445; cv=fail; b=HVSsJagBdZluevKg6tKVPvVB2Yo0V4vOllM7HZXGIYxIRG+V1PwNLj0QfCJgom9chp35wIdGM6Yzg8G2V/uf2BTaTA7qw280lI1rlAxa/H27m/ssm2NkY+ypjD/AzrErz2dOrpzCBat0WjJ27P8he7H/0AbBqLqvvFyyghWJ18Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335445; c=relaxed/simple; bh=PBx3L/n694IQdZjtag+8/+Ruoe7fNeo2Ye6oAKrPhtc=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=QRvs2uj9DOU1LHl01X45wtZE6l9vyfJsEdZ6J9IJ5Cq+o7zwQtjMhuMjE3hA40/Uf2xSXsMAFSgTHKAVgaFKx1zFameR6RIMZadV7TvXoHtDk8YFEEZASPBkYo4C8jOjtfbNjpZWU8eSl1oOWutxCQtlU4RIOjtVCbH+vDsW/ZU= 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=Hb5moxue; arc=fail smtp.client-ip=52.101.228.8 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="Hb5moxue" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QydVgL84yTj2lf9Bpfv34la2tLcwR15xGZT1qfqxFbAniZFQfsFN9lAV6LBI9FpmDWi7Yb9UmIihGx/xZnO3dWCvemMMxks1JpO4GSWMo/xdMjjGA1Y52Lk4wicQ6+aufOKXu/dRKnVQvC/1WqmyC2OCScxK8qDxMPrc3emSV3dWJ4rQ1Aq/5f7gF7hG10e/M+0oDbb3Uy2DjzdNINovFuw2d41XLpKnY28eEMgrTwUA+UtwVgC7b++4+8AyP6jaBmqnwi8wxCSJAC83YrrwCM0b8fd4ivkqppxYBwRIKQyv+V/dqUKwQIopGk8a17ZhPxERelAo9VLqKBKvqs0baQ== 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=nPenHrchRDo+l9qb/4k6wE6scXWgksz+zFiQnUdeKH0D5dR6IeZBFbByOu4o+WhUHHPtRp0xZ3dA/wVITjkooNPfCoCWUeIzob71Ad5tGJri0eGoT/rlQP2efFQ3E1Twt1WgFF1K7d5zB46I9IpqEPzKC8aeRvxpVlER+sqx7+iLxJCmNZ78rl1gfpHCXK+LJUDOwIQDaC9uEonngllwnBUzf+gY18TNXZNV49HsAZrLukwTArg6Ruv3hrlSKzIIzAxoOquR3bJ1YzjyJUuL8ay+o7EXYPEld6UKk3YSeMvNInmKeSKP9d7Ph0XY4YLgG3CwWZRfTetzf6arn6Zf+w== 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=Hb5moxueGGXz+uok/jDciiC47KbxHeWCxfBQh8Qe4Gi4UoJMMuqkpVzYZVfV1pgFcrsDPUmxFrOjwI3MNEz/HJV07BxbmmJaei/RaIYYpH31fxe0yjB64oqg1X+o9IP5kb7dEJ7hPHAwKIMnO7mVJ0q/E2zRdDgtcl4ii0zP2Xk= 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 OSZPR01MB6831.jpnprd01.prod.outlook.com (2603:1096:604:13d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Mon, 25 Mar 2024 02:57:19 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Mon, 25 Mar 2024 02:57:19 +0000 Message-ID: <875xxb6msy.wl-kuninori.morimoto.gx@renesas.com> To: =?iso-8859-1?q?=22Uwe_Kleine-K=F6nig=22?= , Alexey Brodkin , Daniel Vetter , David Airlie , Florian Fainelli , Helge Deller , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Rob Herring , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-rpi-kernel@lists.infradead.org In-Reply-To: <877chr6mu5.wl-kuninori.morimoto.gx@renesas.com> References: <877chr6mu5.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/2] gpu: drm: replace of_graph_get_next_endpoint() Date: Mon, 25 Mar 2024 02:57:18 +0000 X-ClientProxiedBy: TYCP286CA0266.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:455::19) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: 054b0ca4-401d-409c-b896-08dc4c77492e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: llpXSbCRjkFbxX3NehKm+RpwebPlFoqPUG7qqgH/Devk9mAgA2Gt9vHxyIFxZ4TSnixSfwGTHomnvIASblJK0u08AaMH1e2GiLHs3mXX3pXNy9444lYp9aZ1K6K4R61GaZEn8T47jvgcANaARS6JKLXewrUusK6CWN6/gwSAH/YHwatq72JwGkGQbiuNXzftOXty/VuiATJN8Am7Qz13m5Lwpvr5dJJuck/uhYYTRXR2+Ccr6xDPouaKRIwPCr3YZCIjxyBOUO/+wLI1w6fZVGkRGIX4aemNYo+hhKb6Nx2edUGNpYCKMawlzqrcH23h1vuEm0BXTNZ8ih/jRXtnX9/8/xZ9qE5H4Xwda/3IF6YSxd/e+05kCJfX5mkJGiqfTUCUAVp1S+PPujIUf5xjVHVL4J9xBwkRQDDJGCCqOkXlklUd/1L5qEsywrN/CJ0iOoVKGxZad3SAXkiFry4vYwz3dOkDGAfaTo0KnbMBgSCnR2sfNGyTS0a8wDVmKjq9Ys+6YAHNGLFhcaCDlI1qzREql9zZkDy7KRnCF6HEznrIHKN8p1h+wxwE0HELMf0x6J4JzSEgP3nFuSadaOwkn1qfK9eSxBk5+B+3nqsHTBIsuVZCGKOYg17JXKBTzg3mZ2/QoOvwQudjbQvR82QqZL8vEj7P95+3vdsPvASzm7xDIF6NdVV+uoCH5RbIhsi4 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)(1800799015)(7416005)(52116005)(376005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yTYOGWGrigvSf3xxSPtlbdnqURCsj6PoMU0ekUczqWN2aalrVpJT+z6C2b3UOQI837Br+C0rA+BmghG+NsVvgiZfQWofUXVmhnEbOKVN9c4n5/wncQcwtKJ2cHISYHHlIF000QAOCWkdIekoh8V3SoR+ifoU/ROkTeAdtKcKZaU0/z1X9eCz8wHTu9VsiETnC50dK4GkACL8nnC08eDj3bwJ9fPcesFkx0NjHpPCgOadYwU5j/TJrUuR6Iz/uasLx1CpAFfSJ1O+i7MRWNHbVMAi/tO3OtXaby+azyqN+P0+6DzrS/nU8ip0RxIyci5PF6VbeBvNk/gTCpYfOzWRmuP7s/aXyyuAqxam7gXSZ6rZegxRAqNmJf2nbXkZ4InT2m9iseDAw8/5L8GyS9OmNhsAGNYYERXI8TUgdW7PLjPTe9p7/FtKj97FVsRvfMC2RCi4gCi2SdjIDL+f2UfeWjMif3LLQu+UFnqZHG7A7C06xSzT2wh+I5FOum01iHM+cSfeflY1f3RA+YPnBFZDj4UbVMGYzHwRs+C/tD1FKxoGkXMUm1z3VSksrgWLGE+NuKI69Tzyoa5W0QONPnvQig6vlCPtKKudGEoeYetswykXN3F99macP/n4b4RIbKK40u/xADnSf7b/k8yPMWlUZWJks6YGWzghfR5JdUbbWvIXM8/uKmiYN+VaPibILpwZiSVg9EUHiC0nPtCTfwCSzPf0yy0yzkShyizct2NHiy6kqCzI8A+bpBahixM2Uay4RIlxM56Y1gmOL8AXXb7J/Md6nEB487v9k3znxV4zfvjUniaZGoxpdU2Haw31uUI+tFugiqvVVhS5JeY5syRGyi/x0nLGLAkgAmYGI7TQr2VjW6j12PcxaiKSkK6jMpYIbIv7GEPnpBpJ5/278+WN6JD7wR6+74U1u0uXRTPpHHk1YtC+SSogulgfSje0+FAf7OyfP3WzbCspL0dWckq1QLUi0ZtuxkkhQOUL6YjFSH674SxY7jd8k4funAo174Xk8FIP07mBQfHZJ/j+ZEn/Tqs4XMckESAXAlbJzJIFuEx5QUzkioiyF1/qTHxPRtlzG33qdSexg1QcKtpWV+qa3URnNrrKLignDIeA/rEGiyPxAVs2I28fIArWKZbvvpADvOn4VyoyTsM7U8qneYiMRMKRNmCbKZ38JCbKrQSuCdNzYPKz04lCX/z+qLvHpfSpZ9oLMiqXOJsYd9/LPkNmrklaRdpCvKNxlYXMT/woN4CKBFwi5UHuZh3V3xwBAQ5Sc3jI+/yWdlbRRhtzqtk/kKfhbFeHJaWEF57dSoUgYTXxJUZFLhi4PXOUGI/r8mypJ68w2eChTJyUB332v/hlr3PVczcAA/jWhQ1bn6UtrkDGCevLAi0ZVuyXkblHiXB4oW3LtIMUXVbffQYLgE+cpG2vrjPk7DNn9BiyqugQyASrqPJqzeq8d1bf3t/ih1X8s/ATvPqwc7nSJ1hAG8hKkhQmYVyXKJmQpwWBkehG6FkAKxYeznnBvejQ4YPy+XfX6YqRW9y+l8lYsvQr3HxHI/uiIM1XxArejblw4HsZQnQc6czqPm519VtuMizfUonMYvK9qiJQanqqRtiEqhhAvQs/ZLkHvRqVCYKBDOOJuFw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 054b0ca4-401d-409c-b896-08dc4c77492e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2024 02:57:19.3266 (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: En9w4O26aq8dW3pPzfMOBVvQdzRhRbEI4wJNW4iN3wCUn1vy04G+ACntNqLvRlFnZhgA3vDTdKWzhgIkfORLSgi/SQat85dK/WfEBIgLxwUadR9eOCXo8MQakIvoi++q X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6831 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 Mon Mar 25 02:57:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13601371 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11011008.outbound.protection.outlook.com [52.101.228.8]) (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 E2C9620DB86; Mon, 25 Mar 2024 02:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335454; cv=fail; b=EtdJtY8vKv5UZfmA1SZcWtA6gL7ycmoRIq4lOq7uJI09AHlSGVIqx03F4ujsBef855nvgGFDEVKbEMm1zu10vo34vLmqRV/IVhkz7EoZxUG1UcnlvSdlPJdU+E8faIoWhOKDzPAaUoWZpI7qNZLP2KJ6cmmGDwzj0V4iEmrtTCE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335454; c=relaxed/simple; bh=9D0tmht+UC/To/BNPPRfPIWvJEuU7lMpnpfq5DQo1rc=; h=Message-ID:To:In-Reply-To:References:From:Subject:Content-Type: Date:MIME-Version; b=atynRtyQb+04bnXQjord7TmjzinYxie9NOG2s1y5E37TOxip/7gFSe9bpbm/7DzzMBR12G39FPzlKWF/ItnxNfn4lPq50jc81GQFOJl2rCDO0dMLA50+7GTVdrwX0DUZlJhbA2LszrbgrtMi2bfL0t9W8Zy4Lqw6RpB9hcmkndQ= 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=GawgjypN; arc=fail smtp.client-ip=52.101.228.8 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="GawgjypN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H9ifmTAGubjJt2gdrQqc0nmzjHUxpKH9EmX9Y+suhYB5z9rlpmHFbPH1QEnbxglkmhLDvnkPymeT/PKFb/4wUlLH0MOCX8P13ogqb6zO9WcluqnBoAW8FBdfht68paeYcfjE2HkAZwJ9L3gi6gUw32eiH7PgUJg0gj/Y1BI5L6/8PK5hJ9NJDfqQnqpU009ox6ptEDd+Hv1ag0dsCT0eMWJmVvPjt7dhJPok5Q2SbVmnTjngrH16gZyEqkiUOy4F+qF3Eg3feuIFpJC54AD4+vNgPdXftNODmGhxdb5X67NW2vKsOELHq6kovnk+KkRSdghpIyZhDsp/+Mq7uO3wHQ== 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=YCBS7HrIQwwgyjRx0VFm9JKooJmcU3m4uujY1HpGRQ+JlKGbAjFO3lySJIMY/v8nIstnu7ie84fn7FpEzPzrOdP10uLbra8UHGMMWlh/edxoY+qGxmmednZd3t04JDcvj7DKO4Dfo+fWtj0XWLNcETb3uwVc/ce2cr4q7gPh1xge5LPViUKVx2Nj6LIJNQixn0FLAcTEWF7mQHw/9bA1P77HuZpat5IGS2z4J2uHYnRkbbLdlt5GtZ3H6+Mv/htFj8IJz/WXIrlNCp9wy8bKa4I2glt2DHecVksIkOEtHBxEEsAUW4C7q4OOTpG1lceqfd8A+7Ve+OcsruDUiROmqg== 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=GawgjypNh/y93otajLRDRbBzl5ZyIct+KRQUJ0f53qGPn1r9zjK/BjLH4HneRM2mkpf3DhBGI5bPXjlVGRTGZeikOALUErvgcPc/MDlsnZgtmYTJtl0v1vrKB+fOvR7j47nVjsIwP75fvmCVLf3TMi0B0v9vWJShaY2QdoFk+Bw= 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 OSZPR01MB6831.jpnprd01.prod.outlook.com (2603:1096:604:13d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Mon, 25 Mar 2024 02:57:29 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::131e:55c0:a4a0:713b%7]) with mapi id 15.20.7386.025; Mon, 25 Mar 2024 02:57:29 +0000 Message-ID: <874jcv6msn.wl-kuninori.morimoto.gx@renesas.com> To: =?iso-8859-1?q?=22Uwe_Kleine-K=F6nig=22?= , Alexey Brodkin , Daniel Vetter , David Airlie , Florian Fainelli , Helge Deller , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Rob Herring , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-rpi-kernel@lists.infradead.org In-Reply-To: <877chr6mu5.wl-kuninori.morimoto.gx@renesas.com> References: <877chr6mu5.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 2/2] video: fbdev: replace of_graph_get_next_endpoint() Date: Mon, 25 Mar 2024 02:57:29 +0000 X-ClientProxiedBy: TYAPR01CA0234.jpnprd01.prod.outlook.com (2603:1096:404:11e::30) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB6831:EE_ X-MS-Office365-Filtering-Correlation-Id: d02b6376-0a4c-408f-04d6-08dc4c774f6d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3mAxNal8cSc7+E+xx7VB9kOa+G7NafQa+zwt1rwfbq0JdtNn1mEFagYAkj4YMld8Sm8SsthdP/9kNb7WxjGOj8PnBSnd+oCwJrpGbBM017ArG3EN+Ksm5T0bhaVyiHZ4deO7icoXRIyrFPW09+6VB/rxxSPduvo4qbziV3vpF6ZGfb1ZZ4ee6vdHyVbqpf9Mm6U9OSSrNyEyPkIHD5t+MwFpvP5jFZR8TJsbmZjPWADA4/ifsdx1nI+z/nXP7pEPn9BdwuWjB4bk+BHAQ2V4F/0XIoWINCAe/lGb3ab3jCO8JA5DQYiaegxt8LP3mxDKOiauSomIJxzfL6Bg8C1TWlwK+tnSfo2uiOtg5hdb78I5/fwHmyfiXDsfNvbGPKvDp+RwzbfCslepaWuEqths/G69QUX7/jfvQ/e5INNOSpx7lgtGHJ4uNZKA9fdr7CXPtyRDmL5FZQ8pf+hvYBtxj+oG0c0KdTrxkigyNHcmTzmP1x7GqvBH8ECYYx4HVwbf8k8WGEd1Xv8w+7NA3cBRRequZdhbH3AkYh8IxishNZlJyb+3WQdCAdIHviEgidJP28dBtuUgZ75oUqG58d81h99vgmDC0sI+SjE52WesK8gD9YqoNYeCQ/X/P3mz5A4dl0nFa17KqTdZ43p6imt1L4PlFL/BSzUlQOQHaOlvH7I2k7+RluGrgSwNe9HwxEv2 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)(1800799015)(7416005)(52116005)(376005)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 96LSZ6JGTAZndhkCoekZVMOctVBYOwD+Ic2u6++Tzo9Bkt1CgFGkC8JBS9m/DAeaeIe+eSDCKB8BKk9sLvWvc3kYT89oKsvT0nBm/nbaV6+OT+rljQIy+qwvWs2VP4EHZ7oxMVA8WqswoOHpqZCP1ivK5ebRgEZB4aNIWccHK30tfYK2oT8bdbznK+2OLm+y6HwFdhL0vU4iOXAmKiR6k8aGivG/gpYsn++swxJRqHRgYRLGhAU+L/agQKYeobDrpCYm6+572TPVF7O11oXfYnHTg+inzMl6f57/riG2l5ebsT1J+xVzBac97LkOxD1WfUJOdmMJpyMlVfN81s6Ga/9JkZjEv+plg/nPjNdTt72KVkIYwNep58Gc/msdtcNlyFKqoCev2dvmBFTybgpTZoEIy1V/mwb0ZLqvCQ4Clk2eXdZtqPmvhUzxHoIrW8QWH9vYoNFJ0vvGuWaISPy2thLYIHC+aI3CBgp+IJ3uWHo4JA/dKo+eA78wEy4vXu1+WwhdwbK7wPCxd+Xa60gRGhW+ZMw6KnRX0m/m46nYPB8/sVLPBvFaxdMnkoEzxZpjxQBHmXeVRZk0ZPjC6z7MPPqNlvYkxTEBKVmIQqH1+3EEHvxVg1uj+jGyKJ6hNx6CcR25V0M7Cz09gg40nCJRGfM1SREkdChoCZiFTc7zGZ615VVBce97tQu10a3NYzcq40DabZ6g2jU5STLDofGr+LVdibgXy8Cf6bXQbktYn97JnlwmmQcYVEW+pRLrze3UYYpEbTVYyASpYe1Y8iZc/4cX0LOJGmhh9r/9gWQ41CG1+EGH9kvDNKRLWrDY5+Jjh0bTpNUDK4vp0Vwy1ZVYlpuiCgEGoAxQ6Ep07bc170uUszh1g8/yfXFE9dqdTvoSdXHq2iBsq3gMeR5eNEaERVD3b6CLyhZi1DJ4dIM88w+lJ7EPU719uWjsJF0YHYb915VwtW2Z/dPo5xEsXsDJFcM59zKBXn8wIuDUypfdExl4i7Ew3wwAp3h9peJzEfGh61zsL0v5Uo9kya0eiI1kTkzsTYzsznLRFhP7LR1ROImVBJU2sDWHRVZEkR2V+htz9JGV+0JEPosS7uficM/IVfQ8X4ZvpWr63oJKI370i50jtPyOPXDgmUYztwgaoSJdIlNpMbIxR/0MKRnY4kIBm3wDe64BOZdJ9g3SKIlfQ2QyXQOQboOdr07xSc8FFBJ7TGkw2G+vZhWwY9oVrQcifo69pgUsA8mcuw5jB753Zil9ycpErZ3UhRCcps/MqLMffNRF9QCTqSM4n3pZXERMHSfhdmBHOPD9fMGos89m8lffFqVtzrjc6OT6empJbCypkvodAU4S5e48w5sT+jfHc9fgzacUWPCygnbGXhgMVqk41yLF2YInrOM15kXxnXOgRp1FFrHOsvB/ZWM8p2JFE/VyTzFsKuRtQZrRZK5pMAwZiYD6lz07dMey2SYBsKi9uXmi9iJcdsD8NRgLIYuQMQaZ/AxHUClkGpKyK+vkQQ3fYPJQ5z26z+4ORCKhOqbqW4Qj1Xjp5EUREks6CX6EI/T0eafs6ZdAq6r1WZg14+MpSI/5iyPa+zZjE6WoBgIAlnoYBxZoV1y9YPcMPBSgn1S3i1WcXYdzA/cALAROaC4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d02b6376-0a4c-408f-04d6-08dc4c774f6d X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2024 02:57:29.7813 (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: qY78S5f4+JLcLSQlhqJs+qoEzXz3kPb0JZHmiFtqGJ6q7dwlGfIDr9bRmyaVmbookWs02lj9LvTVobXy3vyyXjf0q0sMmmzaGpwoVc/1NJeE/Ad8iwFsiP+OdXuuCXyq X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6831 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