From patchwork Mon Jan 26 13:12:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 5709351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 941909F2ED for ; Mon, 26 Jan 2015 13:07:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA0C8200F0 for ; Mon, 26 Jan 2015 13:07:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5E350200F2 for ; Mon, 26 Jan 2015 13:07:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C366F6E0DB; Mon, 26 Jan 2015 05:07:12 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from gloria.sntech.de (gloria.sntech.de [95.129.55.99]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FE8B6E0DB for ; Mon, 26 Jan 2015 05:07:11 -0800 (PST) Received: from ip923444a8.dynamic.kabel-deutschland.de ([146.52.68.168] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YFjNb-0000B2-9f; Mon, 26 Jan 2015 14:06:59 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: dri-devel@lists.freedesktop.org, Dave Airlie Subject: [PATCH] drm/bridge: dw_hdmi: adapt to updated bridge API Date: Mon, 26 Jan 2015 14:12:02 +0100 Message-ID: <2147669.MYb46qfbGd@diego> User-Agent: KMail/4.14.1 (Linux/3.16-3-amd64; KDE/4.14.2; x86_64; ; ) MIME-Version: 1.0 Cc: Andy Yan , Ajay Kumar 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commits 8eb17f05bc18 ("drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init") and fbc4572e9c48 ("drm/bridge: make bridge registration independent of drm flow") changed the bridge API without taking into account the also newly introduced dw_hdmi bridge. Therefore adapt the dw_hdmi bridge to the new bridge API. The bridge struct is already allocated using devm_kzalloc, so the destroy function can go away completely. Signed-off-by: Heiko Stuebner --- Tested on a rk3288-firefly board drivers/gpu/drm/bridge/dw_hdmi.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c index 4cc4569..37e8711 100644 --- a/drivers/gpu/drm/bridge/dw_hdmi.c +++ b/drivers/gpu/drm/bridge/dw_hdmi.c @@ -1373,12 +1373,6 @@ static void dw_hdmi_bridge_enable(struct drm_bridge *bridge) dw_hdmi_poweron(hdmi); } -static void dw_hdmi_bridge_destroy(struct drm_bridge *bridge) -{ - drm_bridge_cleanup(bridge); - kfree(bridge); -} - static void dw_hdmi_bridge_nop(struct drm_bridge *bridge) { /* do nothing */ @@ -1468,7 +1462,6 @@ struct drm_bridge_funcs dw_hdmi_bridge_funcs = { .post_disable = dw_hdmi_bridge_nop, .mode_set = dw_hdmi_bridge_mode_set, .mode_fixup = dw_hdmi_bridge_mode_fixup, - .destroy = dw_hdmi_bridge_destroy, }; static irqreturn_t dw_hdmi_hardirq(int irq, void *dev_id) @@ -1532,7 +1525,15 @@ static int dw_hdmi_register(struct drm_device *drm, struct dw_hdmi *hdmi) hdmi->bridge = bridge; bridge->driver_private = hdmi; - ret = drm_bridge_init(drm, bridge, &dw_hdmi_bridge_funcs); + bridge->funcs = &dw_hdmi_bridge_funcs; + bridge->of_node = hdmi->dev->of_node; + ret = drm_bridge_add(bridge); + if (ret) { + DRM_ERROR("Failed to add bridge\n"); + return ret; + } + + ret = drm_bridge_attach(drm, bridge); if (ret) { DRM_ERROR("Failed to initialize bridge with drm\n"); return -EINVAL; @@ -1700,6 +1701,8 @@ void dw_hdmi_unbind(struct device *dev, struct device *master, void *data) hdmi->connector.funcs->destroy(&hdmi->connector); hdmi->encoder->funcs->destroy(hdmi->encoder); + drm_bridge_remove(hdmi->encoder->bridge); + clk_disable_unprepare(hdmi->iahb_clk); clk_disable_unprepare(hdmi->isfr_clk); i2c_put_adapter(hdmi->ddc);