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: 114571 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp474914qgn; Mon, 2 Oct 2017 02:35:30 -0700 (PDT) X-Received: by 10.159.242.194 with SMTP id x2mr3285342plw.244.1506936930328; Mon, 02 Oct 2017 02:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506936930; cv=none; d=google.com; s=arc-20160816; b=x+1Z0VJgCRUkmq48Si4KiP0ZIZTpHZiFE0HOWFBcHdmB24SPAxVkdvoPW6o5i5Yeds GkNWmXnFCXAowCneMVVoC9gyy1806zWERMFVVH+s4Z0mBwfDnJnfspKJWv3INj35R+n3 +zjNCUUrCobCZaOTLqN2HYZMRNC6uDaFmD6EaJG0RFz0A7PGHa/fsVGTT+hdVRueUXfG C/OljfgbvpW3Qv3xxWGD2VQ/kC/FJq0PaeDpf/Qifj5bywYp3fLtS2NtAVItRsh80PE4 QHwnr7FqZuVyrwGUPCyKgJ9qRyK4MYCi54WPkdF/F/9lV2IVgJBR6+aKaTYChhn61Gf1 7tEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=KaMdpbkfWbz5jhb2FFnLSXsXieqyM9vAuBryBmblHkE=; b=nAub5OGMwUYN7rIPaXzzYpdwMoSHQwnJeRZvK/UnqwBDCwTFsOjTvQNkhgRzsVRdCh 20GNYiwJGjitqFCcMH1G+PTsZPJsWo8Vqor5x9fkdEdrEDQSBtQuUcw7n4RyMA8BEKWV Lp2EQCiO3e94kvlN1vl+wYjLN7KK0emztOxMR5un/pVhHkYeBjBdbsKSuSU68QUWvEpW f+6m4W2PrzrPey4F+D1YwT9oH405acDK7mHQVuvv0QnLaZP0MY1NeCm+qyvAhldIlObR ZlXK50qeBTVuGeukFW1cRD0zmL0hYBG+/VT6+hs2awBJ4sNQUI4Uu7LXoxxL5YvZo7Ma J2lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HXZkAv7V; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si7963363plt.273.2017.10.02.02.35.29; Mon, 02 Oct 2017 02:35:30 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=HXZkAv7V; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbdJBJf1 (ORCPT + 26 others); Mon, 2 Oct 2017 05:35:27 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:46563 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbdJBJfY (ORCPT ); Mon, 2 Oct 2017 05:35:24 -0400 Received: by mail-wm0-f41.google.com with SMTP id m72so9352624wmc.1 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=g4c1ZBz1CoRcKtPeaCftHbH+RycK7f9qdIWXs9DLCouVu2MjAyr8u3vb5zhNsI4aBW w33cIZumc5NtufuCjVij/8FCfffTrcrh+KGl98JMOObcDap9cupYg2NK4SsrcMtan8lU aAO/WuuyJW0SJ/PnM3ZlWc8zmub1Liq7UWx5PulN0MP2W+MRxWvd+wA5AHp8OVNwQyfa 56NEdJtrUrNY2u/0UGy8w8kzMERe0H981oudLEnk6PSdZVUnH7oyzKF3VouXMkYGAr48 3wb3HBNL9rjZdREmtOpm1gLEKPYmT/bxyqwgh0m2FmGh7cA5KfFMTKpzd/grR0oe0TYb gI5g== X-Gm-Message-State: AMCzsaUjPR4HdXZtMWakd0LUbjp+CRB0+O7o0yZQuZZVLwGrvpg/WecK SlwfK5sGXxs1InCdmaMjrDoong== 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Benjamin Gaignard 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/gpu/drm/vc4/vc4_dpi.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) -- 2.7.4 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);