From patchwork Fri Sep 21 03:28:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bibby Hsieh X-Patchwork-Id: 10608967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17ADA1508 for ; Fri, 21 Sep 2018 03:29:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 032A92DFFE for ; Fri, 21 Sep 2018 03:29:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAEAB2E01F; Fri, 21 Sep 2018 03:29:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 24F592DFFE for ; Fri, 21 Sep 2018 03:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EsvL7JaxSKmbvPdbj1ADxx5ZcgGxXktowJu+tj8T5qM=; b=NL95zhgx6GuXMX vMwx8AeaV1EE5FiYCDNJRrBOo+Uo3GbkHeAvishJ/R9B5tujW9tdGPzyi+qxTobsfQvzXq/MzHbDn uM4VPaS7DyiiIyH2+y421RX6TbieBL6gEmcHot9rTVCRPj5AgCnLmW9mwG+MO4KpyqWjOkzPZV7sR /RG9ngp66KM6AkoS3MSyrXZt00zJPibTw9rzzxmerfCvA/Rwpr3Cw0Jw/uQuLaPp4o10vavV21Jhz ScBFxXEPyMB5lkPrtXaN5s+TxaFu6ylJ57NaHoQmEO2HeT6Vbts1Oe7hq6sgHs4YtNylGTunvw98q zkS4ArRNPBtR53mT3MMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3C7i-0000GM-BB; Fri, 21 Sep 2018 03:28:54 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3C7Y-00009e-E0; Fri, 21 Sep 2018 03:28:48 +0000 X-UUID: 051b9e8bede04cf6af4a03b387b8e3e3-20180921 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1383180600; Fri, 21 Sep 2018 11:28:27 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 21 Sep 2018 11:28:26 +0800 Received: from mtkslt209.mediatek.inc (10.21.15.96) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Fri, 21 Sep 2018 11:28:26 +0800 From: Bibby Hsieh To: David Airlie , Matthias Brugger , Daniel Vetter , , Subject: [PATCH v3 05/12] drm/mediatek: convert dpi driver to use drm_of_find_panel_or_bridge Date: Fri, 21 Sep 2018 11:28:15 +0800 Message-ID: <20180921032822.30771-6-bibby.hsieh@mediatek.com> X-Mailer: git-send-email 2.12.5.2.gbdf23ab In-Reply-To: <20180921032822.30771-1-bibby.hsieh@mediatek.com> References: <20180921032822.30771-1-bibby.hsieh@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180920_202844_619038_4CD2F4CC X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bibby Hsieh , chunhui dai , linux-kernel@vger.kernel.org, Cawa Cheng , Mao Huang , CK Hu , Thierry Reding , Philipp Zabel , Yingjoe Chen , Sascha Hauer , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: chunhui dai Convert dpi driver to use drm_of_find_panel_or_bridge. This changes some error messages to debug messages (in the graph core). Graph connections are often "no connects" depending on the particular board, so we want to avoid spurious messages. Plus the kernel is not a DT validator. related links: [1] https://lkml.org/lkml/2017/2/3/716 [2] https://lkml.org/lkml/2017/2/3/719 Signed-off-by: chunhui dai --- drivers/gpu/drm/mediatek/mtk_dpi.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 022ccec49cea..7a4868a0afec 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 @@ -697,7 +698,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; int ret; @@ -743,16 +743,14 @@ 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->of_node); comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DPI); if (comp_id < 0) {