Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5317585imu; Sun, 25 Nov 2018 21:31:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/VHkP3UrI+LpewH/m5tf9O21c0eZmow6MVJouMSasAk0sXKbN6WlIMAqLzQaosNHe/70Mn1 X-Received: by 2002:a17:902:3225:: with SMTP id y34-v6mr25498508plb.227.1543210291761; Sun, 25 Nov 2018 21:31:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543210291; cv=none; d=google.com; s=arc-20160816; b=zWGYMP/ugIrmaA89lQ28hyff64PjM8Hylg3xOeCs8tYBvmw6x+jKOE2+qbDq8DOWhu NTSWE9lWTWQMNBiukNGy2ihy4jYmYXWR8jAZq5TVtMGV4ITuP9rMsW/8XT5savaeoeEs sVkv0sw67P9ll6XicjsTzUF+w/Brmauk1tVAHscSYHxH0x9V1yDoozc+Yg6JiS/twex0 xVwVCfPhbG/cUcgRMutfjyHZNX/TctgkL5D0fnzerK0fswRu0P9YYqlCvr3rcVSb4Nb7 xYbg5PojfWIwC8R5vtbWG6kVp3h0dJtlYC7od71buGaE1+crD5w5JWYyd2XF49yq81C2 0E5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=sfGSiC2DbqBs8fecXb64ARSP3SxHHsY5brBQWKde8zA=; b=zXPhBSM4kv6zH1EZqlakr0fxajoRsdFT4nQrHSPlwDlNnoHytkgbwtiaRM54ldBktC jAWWEtTArOThzv6P9BHgQ+u4heMkGt9CfGIH7JFeuIX8RO2tq9tTw0KcIaKLa6hadV/z U+Kl0xLw0x3/ZqYoZ0wvA8Duvn1y0g8TBtq/Xt6Uw1ZceyYDTXvbT2LJbKVoubtkHzXH kmdhmcB3+u8ZE09r/PghFGc3+T+FKyq4hjVKj+x7dy7jpSrFnWDtQHwERzVztiAy3UX5 jaOW42UZZCaygJ8K+nZnd5JhELyeKYV5aw4PH6bEWdNMGfBuATCw5l9ipn1+uMvgT2Mr DUzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6si50283487plz.220.2018.11.25.21.31.16; Sun, 25 Nov 2018 21:31:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726298AbeKZQX3 (ORCPT + 99 others); Mon, 26 Nov 2018 11:23:29 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:27251 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726145AbeKZQX2 (ORCPT ); Mon, 26 Nov 2018 11:23:28 -0500 X-UUID: 322d924fc63448108ea5f03f7d6d5ce9-20181126 X-UUID: 322d924fc63448108ea5f03f7d6d5ce9-20181126 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1253449590; Mon, 26 Nov 2018 13:30:02 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 26 Nov 2018 13:29:59 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 26 Nov 2018 13:29:59 +0800 Message-ID: <1543210200.1796.2.camel@mtksdaap41> Subject: Re: [PATCH] drm/mediatek: Only try to attach bridge if there is one From: CK Hu To: Nicolas Boichat CC: Philipp Zabel , David Airlie , Matthias Brugger , , , , Date: Mon, 26 Nov 2018 13:30:00 +0800 In-Reply-To: <20181126040737.138682-1-drinkcat@chromium.org> References: <20181126040737.138682-1-drinkcat@chromium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: 0A7AF0185B64A501D509B3774DF140A431209166BDD2867CD57FF28CC137D2382000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Nicolas: On Mon, 2018-11-26 at 12:07 +0800, Nicolas Boichat wrote: > Even if dsi->bridge is NULL, we still try to call drm_bridge_attach, > and print out an error message, before creating the connector. > > When no bridge is provided, let's skip these 2 steps and directly > create the connector. Reviewed-by: CK Hu > > Signed-off-by: Nicolas Boichat > --- > drivers/gpu/drm/mediatek/mtk_dsi.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c > index 66df1b17795921..27b507eb4a997d 100644 > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > @@ -818,10 +818,13 @@ static int mtk_dsi_create_conn_enc(struct drm_device *drm, struct mtk_dsi *dsi) > dsi->encoder.possible_crtcs = 1; > > /* If there's a bridge, attach to it and let it create the connector */ > - ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL); > - if (ret) { > - DRM_ERROR("Failed to attach bridge to drm\n"); > - > + if (dsi->bridge) { > + ret = drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL); > + if (ret) { > + DRM_ERROR("Failed to attach bridge to drm\n"); > + goto err_encoder_cleanup; > + } > + } else { > /* Otherwise create our own connector and attach to a panel */ > ret = mtk_dsi_create_connector(drm, dsi); > if (ret)