From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9888C433F5 for ; Thu, 6 Sep 2018 01:50:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DA872083E for ; Thu, 6 Sep 2018 01:50:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DA872083E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725981AbeIFGXE (ORCPT ); Thu, 6 Sep 2018 02:23:04 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:26794 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725850AbeIFGXE (ORCPT ); Thu, 6 Sep 2018 02:23:04 -0400 X-UUID: f453f56ca0774649ab15f3e6eb3a6b4e-20180906 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1760556777; Thu, 06 Sep 2018 09:49:57 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 6 Sep 2018 09:49:54 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Thu, 6 Sep 2018 09:49:54 +0800 Message-ID: <1536198593.4618.9.camel@mtksdaap41> Subject: Re: [PATCH v2 05/13] drm/mediatek: dpi use new API for finding bridge From: CK Hu To: Bibby Hsieh CC: David Airlie , Matthias Brugger , Daniel Vetter , , , Yingjoe Chen , Cawa Cheng , Daniel Kurtz , "Philipp Zabel" , YT Shen , "Thierry Reding" , Mao Huang , , , "Sascha Hauer" , chunhui dai Date: Thu, 6 Sep 2018 09:49:53 +0800 In-Reply-To: <20180905083146.14727-6-bibby.hsieh@mediatek.com> References: <20180905083146.14727-1-bibby.hsieh@mediatek.com> <20180905083146.14727-6-bibby.hsieh@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Bibby: On Wed, 2018-09-05 at 16:31 +0800, Bibby Hsieh wrote: > From: chunhui dai > > Using new API for finding bridge. > This patch looks good, but your description is so simple that we don't know why you want to do this. In [1], Rob wants to clean up OF graph API, so in [2], mtk_dsi.c use drm_of_find_panel_or_bridge() to do this clean-up. If your reason is clean-up, describe it in commit message. [1] https://lkml.org/lkml/2017/2/3/716 [2] https://lkml.org/lkml/2017/2/3/719 Regards, CK > Signed-off-by: chunhui dai > --- > drivers/gpu/drm/mediatek/mtk_dpi.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c > index 3758cfeb586b..ed2c153c70a2 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dpi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -708,7 +709,6 @@ static int mtk_dpi_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct mtk_dpi *dpi; > struct resource *mem; > - struct device_node *bridge_node; > int comp_id; > const struct of_device_id *match; > int ret; > @@ -758,16 +758,13 @@ static int mtk_dpi_probe(struct platform_device *pdev) > return -EINVAL; > } > > - bridge_node = of_graph_get_remote_node(dev->of_node, 0, 0); > - if (!bridge_node) > - return -ENODEV; > - > - dev_info(dev, "Found bridge node: %pOF\n", bridge_node); > - > - dpi->bridge = of_drm_find_bridge(bridge_node); > - of_node_put(bridge_node); > - if (!dpi->bridge) > + ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, > + NULL, &dpi->bridge); > + if (ret) { > + dev_err(dev, "Failed to find panel or bridge: %d\n", ret); > return -EPROBE_DEFER; > + } > + dev_info(dev, "Found bridge node: %pOF\n", dpi->bridge); > > comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DPI); > if (comp_id < 0) {