From patchwork Mon Nov 26 04:07:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 10697539 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 9646314E2 for ; Mon, 26 Nov 2018 04:08:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85A4D297E9 for ; Mon, 26 Nov 2018 04:08:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76E70297FC; Mon, 26 Nov 2018 04:08:03 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 2A0AD297E9 for ; Mon, 26 Nov 2018 04:08:03 +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: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:In-Reply-To:References: List-Owner; bh=vGNW1c4lSZ05EFJSW9dL+5XDTOQmnj9FpIb1OFjmc3Y=; b=l9VzDqmZCmgzlD LcnK5mdC/lyiyPnssYet8bJdO4kEXfAH8gDJVa0t2SnW02DXOajJw1rntJl5QMF3IjKMO3cEZf2Pl v0Hdtr3vrfWuZEsy4BVqh/eibkPSxOw07/4/wlS6pJ9HeKpv8xN4Fz0zUzQQNFe6qyr2HEZ6sJMnp O8DG6IkdNmHpGBx7B3r1IqeCrzW/kmf7ES59pTx/Ckr8gOPvU/qzVMD0JLbDhUphfil/jnUMjszFB 5M/oqMSwnhGoyvD5nrdkYp35Df9ImBjHwfzQs7eDPXPblUMraPG1LCr5RF6qAL9aP+OvyVQO5Id/K BCWFlG+6Ex/ge3hD3zJA==; 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 1gR8Bk-0008B4-08; Mon, 26 Nov 2018 04:08:00 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gR8Bf-00089k-Nm for linux-arm-kernel@lists.infradead.org; Mon, 26 Nov 2018 04:07:57 +0000 Received: by mail-pl1-x644.google.com with SMTP id t13so13196557ply.13 for ; Sun, 25 Nov 2018 20:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PcYxqSLEBxrtZEfSqHikCvgwNVEYCzsR6Neext4Petc=; b=dVeccttXPOe83UTvldqsO0tINFcU9nwZGHJL2cfuqxJOPjVd86Dlbgj0ndSc1dT/Mk YZW3FyiITIXq3gkUBvpgpsHWTAxN/Al3pMp83rZZZ6EV6h0FiOapn0G+VqwPOzZ8ITLr sxkty9Y1YkU+61p23PufbvKPZB2ffffQjHwww= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PcYxqSLEBxrtZEfSqHikCvgwNVEYCzsR6Neext4Petc=; b=njBEGTlDi9RHld1oQhrmiPIk+KdJbqamjdjdw2kK8sDGl7ojo4rfqRYNKJwWs8RXvT gnoJgqLMg7BswsJxDJ4aUtqCiR4HyF/CSBH7iE+IBO1wnNCS3wSfMjqjuYWGicEDcrNn WKn8UYHsWvH13hQwCiuhC81b+gFVdV228venqS3hfVrf7FOnAeFmxjhPuNAgrN1rUhgh 4y1OYkbTIF8o6SpnRFwDF9/D8uQqpb7cDA3Kng7kJmTdJW7MNWwzpqfmQ+74E4+mFIyb uM226y+njJGAN4sf+hAITXlptxzSjt3N0E+2A2wTIgECT0cJFc2lyaFRiM8QfG09/nJb 5qiQ== X-Gm-Message-State: AA+aEWYRzwx3z/osrRjXGmYUhKsfOJg+eF++/HTBWwAaRB1uocKMvO++ 4jIUpiPnEl4qAU3NmZkTpE2VIA== X-Google-Smtp-Source: AFSGD/XYJeDqVnbpbn90RhEzYvePjSInjbew6UjZgBGUNcoJizDG2SfV3Hw4WdEiCa93JpAvDGswWA== X-Received: by 2002:a17:902:b78b:: with SMTP id e11mr25988753pls.90.1543205263235; Sun, 25 Nov 2018 20:07:43 -0800 (PST) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:f659:7f17:ea11:4e8e]) by smtp.gmail.com with ESMTPSA id w136sm55833132pfd.169.2018.11.25.20.07.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Nov 2018 20:07:42 -0800 (PST) From: Nicolas Boichat To: CK Hu Subject: [PATCH] drm/mediatek: Only try to attach bridge if there is one Date: Mon, 26 Nov 2018 12:07:37 +0800 Message-Id: <20181126040737.138682-1-drinkcat@chromium.org> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181125_200755_771725_5CA5A977 X-CRM114-Status: GOOD ( 14.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, Philipp Zabel , Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Nicolas Boichat Reviewed-by: CK Hu Reviewed-by: Andrzej Hajda --- 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)