Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2114582pxp; Fri, 18 Mar 2022 03:40:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGhfwRuBuoLxILGyZ4KhLiD88QBQx1b82Ldjcmh4zgYDZY3ruyzyibyihxipUVUz+dmp4h X-Received: by 2002:a17:906:9754:b0:6da:7d72:1353 with SMTP id o20-20020a170906975400b006da7d721353mr8358100ejy.273.1647600032459; Fri, 18 Mar 2022 03:40:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1647600032; cv=pass; d=google.com; s=arc-20160816; b=fKb4GmpM6KWqGbGSCAnftXn1RkgvopnbY6Vbb0dOBGIVHmTRswHFbZEuM/AEBrQMea Ez6NiBlNuLR2kBlNCxD0Xs7dvtwTMVN83tvMDwfywskTm/wRVKNhslPG4GA5pDyz4b2U o9Tv01egobzNtjMP8Duz04BXTccCk+SDOQQMz3nV9B5OOAiXpJP05i2juYklZOcT4Zp0 jO98JlGoltXDLfAQPOrCZiJH398NfaMB51thodc2ksLmW9sEt0r0QZ3FlNRmhLJQlpH5 eSwEd98zL6t/JtM8k2WpF3vrdSXfc/vUE7B3gVFgJh+bvHS7PQ/UfgulpRFr2GWNFBO+ Gzhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=1fVObxlB+VrJpVwemhItO0oMklaa5RLe6ab7u24PocY=; b=a/hwdCv4Pp9/ney6yB0r444ZFSqRPUJM+OD8f3g3Jx7/SERij2KkTGgYDu+C3luZgl wcXQcqmIEQSG4KCbYbN75biP9n62JAE/CX1u3TXh42to6WXzZjuYUh43fpQRmrO/hVNs VmxFUN4rq7tA+0xPe4pUYVgQ5uYvH6PwxoxciQLlPAb/WXHMkSpUaNzJAz8s/niWsly0 7KqRtaKnBjmOqQl1NymmjQBHsCXimG0K/riyaVT/y5QSFfCESiJGcDpF2VP/a1qXP00N gxgoiYXGzOXM+0SIgRxJtX2Vk7oQVi1YJzefyMLXz3rQw1n2kL5gKlpf8xG0BFPbvWVY US/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JQLH2I0T; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a1709063ac200b006df76385d5bsi1114179ejd.507.2022.03.18.03.40.06; Fri, 18 Mar 2022 03:40:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JQLH2I0T; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234423AbiCRJ06 (ORCPT + 99 others); Fri, 18 Mar 2022 05:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbiCRJ0z (ORCPT ); Fri, 18 Mar 2022 05:26:55 -0400 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50086.outbound.protection.outlook.com [40.107.5.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 797A02AD0A9 for ; Fri, 18 Mar 2022 02:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U3DNUTFmkx6KA+L/6elSUndAcEmfZURRQG3vcAIVI5Ic+oqcIJcxW7cv66+1SGU2nKxV/WT902kWcdo2KoriL9tnh43R3Up5Z2BfUH4sV7QYT2p16Dy1Zn0ErT62JRUi4KaEdCTzbJqiqrG32j9RZxL5ElKmGl4ZYXvTDiiA8+Ld0QdVQYBPBeB32d0SxKDhIxwcK724WxZgCk3RONU40WqcyT3rcmSDO1Clt18AN9Q/WtKrM1HOD26jg0zD4qaPgZyg96E7E5LEMBit6YBvr9WDR5HFpLfEXWovOb0bhfexeA1Al0WNdkkt1iV6JZyF+voaECx/RS0gR4/qSsSO0A== 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=1fVObxlB+VrJpVwemhItO0oMklaa5RLe6ab7u24PocY=; b=GxNhcBhxxsZoRZg+XwXb0tIk7OByR5nnGIMR3lq4kpMNmtN3rU9Opl0IDT8jOxXjzGrokyK9zJmCQsLKaxst2D+GZt9gd4nDQtABmqhLkplNQ50KUQZalnrblfJ6iaB4p01DWAGbCCz1L/36Xui+jh4eFysgnEI1gn+ZEdWL6p3hCJzjAShA2zZ77J5L9jvvTOME/GaWpRojYKwWabdo3M1whUT0bXPSy6Rtrsd1m3wCXH8kAC6jAa95BVMFivwXs9NOZSYrhG9Kw+/TdCv6Obi4sFK7otSExqn6vpSNcyavTB+pzWcn8Du/Mv32i/qMnHuc8KH4aipqEu47nGZnVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1fVObxlB+VrJpVwemhItO0oMklaa5RLe6ab7u24PocY=; b=JQLH2I0TeXCEgYPJ2/vWaV7X5+Ou3B+THRg1OArkD/9dcY0MbkB6m7nr1EOnzr/xlZ5/+N79MSSh553wdWusbyiiH11WQjS0t1ovL9LsdTNC4WlW1hcRwj8ERtfdyv8vgzcin1lQX4Dr7GZ3aFNPR3Ql/ExAs9pkUozRkDsFD4c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by PA4PR04MB7710.eurprd04.prod.outlook.com (2603:10a6:102:e6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.18; Fri, 18 Mar 2022 09:25:32 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::b09c:8ffe:8e02:7387%9]) with mapi id 15.20.5081.018; Fri, 18 Mar 2022 09:25:32 +0000 Message-ID: <4bd97d512e95845d7dd5a44d7713c59832676ada.camel@oss.nxp.com> Subject: Re: [PATCH v2] drm/bridge: nwl-dsi: switch to devm_drm_of_get_bridge From: Liu Ying To: =?ISO-8859-1?Q?Jos=E9_Exp=F3sito?= Cc: andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Fri, 18 Mar 2022 17:24:45 +0800 In-Reply-To: <20220317175852.799432-1-jose.exposito89@gmail.com> References: <20220317175852.799432-1-jose.exposito89@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: HK0PR01CA0066.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::30) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee3abe2e-5c91-492d-666a-08da08c13fd7 X-MS-TrafficTypeDiagnostic: PA4PR04MB7710:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EESW8RL4+e3nlgjfSCZCvBPPIEYsyiCTbwU1oVhtPjZWnP3MuIlJXVN+Caigdo603K6Y8+1xN006/i4on++l28OM05GY0vdcnlGjmeaq3HuRj6xdTBp7H21WJ/j+oc2Q8qOLBsEzbH2XUI7s1rEn1YkLMjwgZ8tmJ+2+x9bRclbLaJzio/bYktdEWFdzkt6nhON+OEBve+IbTnSBXFErzRZybjdFQ3wI07YEyA9XZ+pH57KmSylfVwTu3Pda4TA6UHM4dqOvbNoSgHTD39d9F3pjAC5xzHRfCo+qvSQZ7+xCU5iXlrSqr3ly+X/ciIQdg1j/Jmi+UAH8kUjAz+zle1oK76svo03CLJzJjnY1vXHUSMmS5oIuOar88TTgL1qwpWrQ0rxsKFD+6F+nay848htCbJIq+wiPG9fQd/JEvpxuYCMA3P7xovdBzpewLfw2zGKtNbnwBojd1kiGrTWUhMmYAng/uGqlMAEftuhdGqEcgNKrSTDl148JVmZIml2NBUkJjo9NlbjlRSXQtlmU21ajIP99vOBzRtP1YSFFhh/G8FffJVmWafgbnn03/GRGA2CMpIMAjhKKEylErUuXwa74vyl2cVRStjJ6JLmeeovuoH5/V2so4JAVGfCUGmA4u2zcgP9x7s870vNLhV4hxVpTywyM27FwmaX+GGeD4ChJOcS7hqNNiXzGEshUiNSi0o+K1VHqK/HoV0UQgeBVnVmBqJmoPUpw/LhVqkGXqNoqWoG15AUUQkGcEjSBTA+xwVdi3Qm8R0pqCX98sjEy+iTeCih4ha5V7hhcO1UHYCY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(7416002)(86362001)(6486002)(508600001)(8936002)(66946007)(83380400001)(316002)(6916009)(66476007)(2906002)(66556008)(8676002)(38350700002)(38100700002)(52116002)(6666004)(4326008)(6512007)(6506007)(186003)(26005)(5660300002)(2616005)(99106002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RVRxdTQxVzY3OTVtM3NoUGZLRWpxaWhFZDBrN2JxNk9IVEJmbzRvbXZXOHhh?= =?utf-8?B?WjM2NG55OVh4SGRnM211U2ZjSTN4SXZ5RlJmdTlDTC9RQmhidzJwOW5xUTJw?= =?utf-8?B?NUxGRVJmSHg5eFN0amsrSXlRU0xOSzQ5VHUxN08yYUxsQzNnTkJRMThkakJh?= =?utf-8?B?R21XUFhFM2lvRThzUncxVGJ3bmc0MU81RXozTWFiM2hNNVJUYkxaUVlLN3B2?= =?utf-8?B?QVVyRmw5ajdRSTR2TEtaWnJuTkhhR1kwL3RWZjlEYkN4Nm1DMTFYTUR6S1pi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-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 09:25:32.5243 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EtzzuLC90JbI8H4omsWeoat/IrJgSq4SKwg3JiikiyQaQi3Nse6b5tnjQn8Bh3NaXsaiYOZd8MHm+3cz4J0ubA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7710 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2022-03-17 at 18:58 +0100, José Expósito wrote: > The function "drm_of_find_panel_or_bridge" has been deprecated in > favor of "devm_drm_of_get_bridge". > > Switch to the new function and reduce boilerplate. > > Signed-off-by: José Expósito > > --- > > v2: (Thanks to Liu Ying) > > - Rebase on top of drm-misc-next > - Remove drm_of_panel_bridge_remove > --- > drivers/gpu/drm/bridge/nwl-dsi.c | 23 ++++------------------- > 1 file changed, 4 insertions(+), 19 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c > b/drivers/gpu/drm/bridge/nwl-dsi.c > index e34fb09b90b9..de62e3fc6a59 100644 > --- a/drivers/gpu/drm/bridge/nwl-dsi.c > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c > @@ -912,19 +912,11 @@ static int nwl_dsi_bridge_attach(struct > drm_bridge *bridge, > { > struct nwl_dsi *dsi = bridge_to_dsi(bridge); > struct drm_bridge *panel_bridge; > - struct drm_panel *panel; > - int ret; > - > - ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, > &panel, > - &panel_bridge); > - if (ret) > - return ret; > > - if (panel) { > - panel_bridge = drm_panel_bridge_add(panel); > - if (IS_ERR(panel_bridge)) > - return PTR_ERR(panel_bridge); > - } > + panel_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev- > >of_node, > + 1, 0); > + if (IS_ERR(panel_bridge)) > + return PTR_ERR(panel_bridge); > > if (!panel_bridge) > return -EPROBE_DEFER; I don't think panel_bridge can be NULL here, so this check can be removed. However, even if this patch is not applied, the check is not necessary. I think it can be removed with a separate patch. For this patch: Reviewed-by: Liu Ying > @@ -932,12 +924,6 @@ static int nwl_dsi_bridge_attach(struct > drm_bridge *bridge, > return drm_bridge_attach(bridge->encoder, panel_bridge, bridge, > flags); > } > > -static void nwl_dsi_bridge_detach(struct drm_bridge *bridge) > -{ struct nwl_dsi *dsi = bridge_to_dsi(bridge); > - > - drm_of_panel_bridge_remove(dsi->dev->of_node, 1, 0); > -} > - > static u32 *nwl_bridge_atomic_get_input_bus_fmts(struct drm_bridge > *bridge, > struct > drm_bridge_state *bridge_state, > struct drm_crtc_state > *crtc_state, > @@ -983,7 +969,6 @@ static const struct drm_bridge_funcs > nwl_dsi_bridge_funcs = { > .mode_set = nwl_dsi_bridge_mode_set, > .mode_valid = nwl_dsi_bridge_mode_valid, > .attach = nwl_dsi_bridge_attach, > - .detach = nwl_dsi_bridge_detach, > }; > > static int nwl_dsi_parse_dt(struct nwl_dsi *dsi)