From patchwork Mon Oct 2 09:34:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9980547 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 C16E8602A0 for ; Mon, 2 Oct 2017 09:35:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3A5827F8F for ; Mon, 2 Oct 2017 09:35:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A82E7288F7; Mon, 2 Oct 2017 09:35:24 +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 6195E27F8F for ; Mon, 2 Oct 2017 09:35:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 17E3D6E2F5; Mon, 2 Oct 2017 09:35:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 761146E2F5 for ; Mon, 2 Oct 2017 09:35:21 +0000 (UTC) Received: by mail-wr0-x22d.google.com with SMTP id k62so3419733wrc.9 for ; Mon, 02 Oct 2017 02:35:21 -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=eeoLJu7OPnkyTduxewysehyKuW5MGiUs9/lHFG+2VZ4=; b=Jg1n/xrNd977cJ2SgxrxZuZQq3fV5N0sKUTTrSmnkffCbUHw/eP53CzNQ5shs2mpjD ahM5IQk7miQFFMbIkKq99lgBVp+QDyz+sJvWjwp/wKUNkF4Wa6c9Lm8pckNdAYrKjS7M ikpJ4R6FIa0GvxrJEEd8OL6ka9KsY9AAI7+Ss= 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=eeoLJu7OPnkyTduxewysehyKuW5MGiUs9/lHFG+2VZ4=; b=mQgkumhhYPgJFeF7ImO5VgMDY5ZVPXI10kKThq67s1CI/eyGFDhZyXTX9s3p96R//c vYuizHgROUuGSy19rzAzQCcl+w1FkslAd5bfoH7thVofqZZX2ttKb53shLr3Qx1QVv4K neYrE3RcJpMUdf3qGXC1rHm0drLEMG5SvxXLWFjW/yyYt3aC52MNn+gn/PthZSXtD3dX UIeffPW2A0DIqbR9wQWwqou6U+/p25v5UYZDT68BAlQeGy81MkabHOPRHR6loynJJ30I s/ST+svPNo1aQk6hFV9k+hxFAG1GgAeE/s1Y/evkXu8YG9eKaAh/bWpHbR4ctwhhYsIN vsHg== X-Gm-Message-State: AHPjjUifjU6VVrPVeNsP5iKjNyNQLcmMm9cJXn089uf4PM7GyxHPF1uS UesKpZCFEb2K6Fcp9gVOdRbqNQ== X-Google-Smtp-Source: AOwi7QBC+c93CWcWdwmys91NWUweRpFw53nKfJEvQ1FX0CUvvQhcOuisKiID+Reb4FMs+iBFaWfakA== X-Received: by 10.223.161.23 with SMTP id o23mr15143662wro.103.1506936919935; Mon, 02 Oct 2017 02:35:19 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Oct 2017 02:35:19 -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 3/5] drm/stm: ltdc: remove bridge from driver internal structure Date: Mon, 2 Oct 2017 11:34:46 +0200 Message-Id: <1506936888-23844-4-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 ldtc internal driver structure. Signed-off-by: Benjamin Gaignard Reviewed-by: Philippe Cornu Tested-by: Philippe Cornu --- drivers/gpu/drm/stm/ltdc.c | 16 +++++----------- drivers/gpu/drm/stm/ltdc.h | 2 -- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index d394a03..735c908 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -791,9 +791,8 @@ static const struct drm_encoder_funcs ltdc_encoder_funcs = { .destroy = drm_encoder_cleanup, }; -static int ltdc_encoder_init(struct drm_device *ddev) +static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge) { - struct ltdc_device *ldev = ddev->dev_private; struct drm_encoder *encoder; int ret; @@ -807,7 +806,7 @@ static int ltdc_encoder_init(struct drm_device *ddev) drm_encoder_init(ddev, encoder, <dc_encoder_funcs, DRM_MODE_ENCODER_DPI, NULL); - ret = drm_bridge_attach(encoder, ldev->bridge, NULL); + ret = drm_bridge_attach(encoder, bridge, NULL); if (ret) { drm_encoder_cleanup(encoder); return -EINVAL; @@ -936,12 +935,9 @@ int ltdc_load(struct drm_device *ddev) ret = PTR_ERR(bridge); goto err; } - ldev->is_panel_bridge = true; } - ldev->bridge = bridge; - - ret = ltdc_encoder_init(ddev); + ret = ltdc_encoder_init(ddev, bridge); if (ret) { DRM_ERROR("Failed to init encoder\n"); goto err; @@ -972,8 +968,7 @@ int ltdc_load(struct drm_device *ddev) return 0; err: - if (ldev->is_panel_bridge) - drm_panel_bridge_remove(bridge); + drm_panel_bridge_remove(bridge); clk_disable_unprepare(ldev->pixel_clk); @@ -986,8 +981,7 @@ void ltdc_unload(struct drm_device *ddev) DRM_DEBUG_DRIVER("\n"); - if (ldev->is_panel_bridge) - drm_panel_bridge_remove(ldev->bridge); + drm_of_panel_bridge_remove(ddev->dev->of_node, 0, 0); clk_disable_unprepare(ldev->pixel_clk); } diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h index bc6d6f6..ae43755 100644 --- a/drivers/gpu/drm/stm/ltdc.h +++ b/drivers/gpu/drm/stm/ltdc.h @@ -24,8 +24,6 @@ struct ltdc_device { struct drm_fbdev_cma *fbdev; void __iomem *regs; struct clk *pixel_clk; /* lcd pixel clock */ - struct drm_bridge *bridge; - bool is_panel_bridge; struct mutex err_lock; /* protecting error_status */ struct ltdc_caps caps; u32 error_status;