From patchwork Mon Oct 2 09:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9980551 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F3DB602A0 for ; Mon, 2 Oct 2017 09:35:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6177D27F8F for ; Mon, 2 Oct 2017 09:35:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 562B1288F7; Mon, 2 Oct 2017 09:35:27 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1B2FA27F8F for ; Mon, 2 Oct 2017 09:35:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FF206E2F9; Mon, 2 Oct 2017 09:35:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) by gabe.freedesktop.org (Postfix) with ESMTPS id CF5396E2F9 for ; Mon, 2 Oct 2017 09:35:24 +0000 (UTC) Received: by mail-wm0-x230.google.com with SMTP id b189so5479390wmd.4 for ; Mon, 02 Oct 2017 02:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KaMdpbkfWbz5jhb2FFnLSXsXieqyM9vAuBryBmblHkE=; b=HXZkAv7ViIJSqM8EifaEHQ8VxAegk79KfXzF9UUORbAGiuUkT9pdpqUxZMQBzq2PL+ 4xOLIVF4zUBgReC4jtO8Us4PZLA9i1CG1X60gCBWxpaIaJvEfIfYjJFRxcMKt7KtNc73 jPXeezOxhPdvMEmELxu2nwTNQoN49GwVhiy5I= 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:in-reply-to :references; bh=KaMdpbkfWbz5jhb2FFnLSXsXieqyM9vAuBryBmblHkE=; b=BuxEpyrup7koNzREZLalCCbK0GVRpcIOmJD9qldlzhLPPCZp9fEw9O1sFlsL4/pXxQ A8DcAXVCC3vwHF/DtG0to43XKXmbJlEQcOvXLRuJn6jybcFni11JsKxh12jUuT5ipEgC znvjTSoK/po0jAyZAGONIDpYlc8nE1FXGU5NIaHx6XZ4dlx02QiqQdoBTLMW499/2r03 gPm4sEUB3qYuV/ofbYhDJSV2UYnn6AphqJuOjbFmPQWFk2p8pXHoRiUTomyDpemFRXbR Nj9K1J1iCS80p6kK647dZV+pTc4EopbrP1NU9ucVfbIhSB1SX95zZ5X6PkvtAi2HJoCG 6PSw== X-Gm-Message-State: AMCzsaUY8H5GKYA66BFVq9ul+ddNLyyB2Kc67HfMZ0feIfUjBUI2lCUr 5J3Ku7MfL3JAA19zi1HAZ5XyZQ== X-Google-Smtp-Source: AOwi7QC71V846Vt9spn1me+65QczpKIk5607idLcH+n79P/m85IZ/BjtHxoGDNfg4V5zRNREAt1Cww== X-Received: by 10.28.214.206 with SMTP id n197mr9513615wmg.21.1506936923401; Mon, 02 Oct 2017 02:35:23 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.199.139]) by smtp.gmail.com with ESMTPSA id l4sm6516856wrb.74.2017.10.02.02.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Oct 2017 02:35:22 -0700 (PDT) From: Benjamin Gaignard To: architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, airlied@linux.ie, daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org, yannick.fertre@st.com, philippe.cornu@st.com Subject: [PATCH v2 4/5] drm/vc4: remove bridge from driver internal structure Date: Mon, 2 Oct 2017 11:34:47 +0200 Message-Id: <1506936888-23844-5-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506936888-23844-3-git-send-email-benjamin.gaignard@linaro.org> References: <1506936888-23844-3-git-send-email-benjamin.gaignard@linaro.org> Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP With a call to drm_of_panel_bridge_remove() we could remove the bridge without store it in vc4_dpi internal driver structure. Signed-off-by: Benjamin Gaignard Reviewed-by: Eric Anholt --- drivers/gpu/drm/vc4/vc4_dpi.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_dpi.c b/drivers/gpu/drm/vc4/vc4_dpi.c index 519cefe..72c9dbd 100644 --- a/drivers/gpu/drm/vc4/vc4_dpi.c +++ b/drivers/gpu/drm/vc4/vc4_dpi.c @@ -97,8 +97,6 @@ struct vc4_dpi { struct drm_encoder *encoder; struct drm_connector *connector; - struct drm_bridge *bridge; - bool is_panel_bridge; void __iomem *regs; @@ -251,10 +249,11 @@ static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) { struct device *dev = &dpi->pdev->dev; struct drm_panel *panel; + struct drm_bridge *bridge; int ret; ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, - &panel, &dpi->bridge); + &panel, &bridge); if (ret) { /* If nothing was connected in the DT, that's not an * error. @@ -265,13 +264,10 @@ static int vc4_dpi_init_bridge(struct vc4_dpi *dpi) return ret; } - if (panel) { - dpi->bridge = drm_panel_bridge_add(panel, - DRM_MODE_CONNECTOR_DPI); - dpi->is_panel_bridge = true; - } + if (panel) + bridge = drm_panel_bridge_add(panel, DRM_MODE_CONNECTOR_DPI); - return drm_bridge_attach(dpi->encoder, dpi->bridge, NULL); + return drm_bridge_attach(dpi->encoder, bridge, NULL); } static int vc4_dpi_bind(struct device *dev, struct device *master, void *data) @@ -352,8 +348,7 @@ static void vc4_dpi_unbind(struct device *dev, struct device *master, struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_dpi *dpi = dev_get_drvdata(dev); - if (dpi->is_panel_bridge) - drm_panel_bridge_remove(dpi->bridge); + drm_of_panel_bridge_remove(dev->of_node, 0, 0); drm_encoder_cleanup(dpi->encoder);