From patchwork Fri Sep 29 12:59:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9977983 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 CE5446037F for ; Fri, 29 Sep 2017 12:59:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE8052986C for ; Fri, 29 Sep 2017 12:59:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2A4D2986E; Fri, 29 Sep 2017 12:59:42 +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 6E1092986D for ; Fri, 29 Sep 2017 12:59:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0C126EB95; Fri, 29 Sep 2017 12:59:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D42B6EB95 for ; Fri, 29 Sep 2017 12:59:39 +0000 (UTC) Received: by mail-wm0-x22e.google.com with SMTP id m127so3132931wmm.1 for ; Fri, 29 Sep 2017 05:59:39 -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=dRisnqR6Vv8O3wh1Keu06wxJsCpIypFE+ng8B0AGvME=; b=OWrBqtsX7AS1JTTrW9Idmd0mo2+9h1FRzWn2kQBecW+K6Cwq/aqXqNQ8uLHPRbvBcA CeiZAAyxCemYphps+skmXeKOtfa3JNtlaokYeUt+SUkdLakgg/F0I4vEx9Ren6yEv8jj xZW4zdgDG1aO36a/zJkDUNUqCnk0jXUiHjJMI= 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=dRisnqR6Vv8O3wh1Keu06wxJsCpIypFE+ng8B0AGvME=; b=uNgr2xzLI7vMHUdPYaeABGWw4O9XRmmJ3lVJ59526WwAm+9CNsi9tgDi4gU1/1Eb9n DQf4rVQan5BfpSp+Lg4+Bhg499N66EQRLxw7BC0Fy7JTZ89hFyUGWaBCuhYRYqqUHYI/ D1+H9Ldm+HmN3VfauQJCS1JRzyGRciCdv5YckcQml54t5DiHabVKp14EdGWdjldXKBFi BsC5jPWxLidf01JvRH68MwiZRPFMrB3tyOWCKQh37h+4vmNmWVKFt1VnyEM8cXFWp0da vohmXrMDzZiTjsK/vUOQoxQ8QB+XNqlwYBY7SUzmsZujIDv0ymnsdL+StZNlOIbQf0o1 LK7A== X-Gm-Message-State: AMCzsaXPZIKssCciS6MWNcawERmpP3Sa/KsahB9zsvtZekrjhxfNle4F NEmzX/XKEQAbV3DAAuxIS5+3OA== X-Google-Smtp-Source: AOwi7QDg57seE3FzEkwAj0Y/RoHZai8D6rYW+NLVzmCCJUwSPJN/mN4+3Ppd5lauWrVpWoCKk0Csfw== X-Received: by 10.28.132.141 with SMTP id g135mr3830755wmd.37.1506689978519; Fri, 29 Sep 2017 05:59:38 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.91.35]) by smtp.gmail.com with ESMTPSA id k11sm3269667wrc.90.2017.09.29.05.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Sep 2017 05:59:38 -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 3/3] drm/stm: ltdc: remove bridge from driver internal structure Date: Fri, 29 Sep 2017 14:59:19 +0200 Message-Id: <1506689959-7858-4-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506689959-7858-1-git-send-email-benjamin.gaignard@linaro.org> References: <1506689959-7858-1-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 --- 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;