From patchwork Wed Aug 27 14:29:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 4788711 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8EF8C0338 for ; Wed, 27 Aug 2014 14:37:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00689200DE for ; Wed, 27 Aug 2014 14:37:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 882402015E for ; Wed, 27 Aug 2014 14:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934944AbaH0Ogb (ORCPT ); Wed, 27 Aug 2014 10:36:31 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:9779 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934801AbaH0Og3 (ORCPT ); Wed, 27 Aug 2014 10:36:29 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAY002BYZ8RITD0@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Wed, 27 Aug 2014 23:36:27 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 07.60.02948.BECEDF35; Wed, 27 Aug 2014 23:36:27 +0900 (KST) X-AuditID: cbfee68d-f79c46d000000b84-4f-53fdeceb6711 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 52.C8.05196.BECEDF35; Wed, 27 Aug 2014 23:36:27 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NAY00EVDZ3VVJ90@mmp1.samsung.com>; Wed, 27 Aug 2014 23:36:27 +0900 (KST) From: Ajay Kumar To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: inki.dae@samsung.com, thierry.reding@gmail.com, robdclark@gmail.com, daniel.vetter@ffwll.ch, seanpaul@google.com, ajaynumb@gmail.com, jg1.han@samsung.com, joshi@samsung.com, prashanth.g@samsung.com, Ajay Kumar Subject: [PATCH V7 02/12] drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init Date: Wed, 27 Aug 2014 19:59:36 +0530 Message-id: <1409149783-12416-3-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1409149783-12416-1-git-send-email-ajaykumar.rs@samsung.com> References: <1409149783-12416-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsWyRsSkRvf1m7/BBke+y1gceH+QxWLDm4XM Fgsf3mW2uPL1PZvFpPsTWCwuL7zEavF91xd2ixnn9zFZrDq8gd3i+cIfzBZzD+Za/Nw1j8WB x2PvtwUsHjtn3WX3WLCp1ON+93Emj74tqxg9Pm+SC2CL4rJJSc3JLEst0rdL4Mo49fMFe0Gn asW8E9NYGhiny3cxcnJICJhIzJl9hgXCFpO4cG89WxcjF4eQwFJGiUm/uphhih7PBSkCSSxi lLizaAMThDOBSeLMlklg7WwC2hLbpt8Es0UE3CSaDs9kBSliFvjGKHFh4To2kISwQLjEtK6V rCA2i4CqxJtbD8AaeAU8JBa2HmLvYuQAWqcgMWeSDUiYU8BT4uGO/WDlQkAlSx5fBTtPQuAU u8SfU1+g5gh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0sTAxs1QS5z3Yah0oJJCeWJKanZpakFoE08fEwSnVwMjAcHPdbq0ZPW57p3tv 9r32pGnNLN+eFp08wZUfJYPWysyZtsm/trJFZYvjuo9XlCbtnv3pXffHoyecef/zpsuvjPh9 IcX+9515rZtu1qjX2ynMrXH2CjmzP2vP+5yZEsEyjLZLdOedaWXmnKcXU1vo15H0J85s+Yr8 f3/b3mWvaHqp6uFnpazEUpyRaKjFXFScCAA6icAu1QIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Assign the pointer to bridge ops structure(drm_bridge_funcs) in the bridge driver itself, instead of passing it to drm_bridge_init. This will allow bridge driver developer to pack bridge private information inside the bridge object and pass only the drm-relevant information to drm_bridge_init. Signed-off-by: Ajay Kumar Acked-by: Sean Paul --- drivers/gpu/drm/bridge/ptn3460.c | 3 ++- drivers/gpu/drm/drm_crtc.c | 5 +---- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 3 ++- drivers/gpu/drm/sti/sti_hda.c | 3 ++- drivers/gpu/drm/sti/sti_hdmi.c | 3 ++- include/drm/drm_crtc.h | 3 +-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/ptn3460.c b/drivers/gpu/drm/bridge/ptn3460.c index 4db38e1..a2ddc8d 100644 --- a/drivers/gpu/drm/bridge/ptn3460.c +++ b/drivers/gpu/drm/bridge/ptn3460.c @@ -313,7 +313,8 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, goto err; } - ret = drm_bridge_init(dev, &ptn_bridge->bridge, &ptn3460_bridge_funcs); + ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; + ret = drm_bridge_init(dev, &ptn_bridge->bridge); if (ret) { DRM_ERROR("Failed to initialize bridge with drm\n"); goto err; diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index fa2be24..25f5cfa 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1022,7 +1022,6 @@ EXPORT_SYMBOL(drm_connector_unplug_all); * drm_bridge_init - initialize a drm transcoder/bridge * @dev: drm device * @bridge: transcoder/bridge to set up - * @funcs: bridge function table * * Initialises a preallocated bridge. Bridges should be * subclassed as part of driver connector objects. @@ -1030,8 +1029,7 @@ EXPORT_SYMBOL(drm_connector_unplug_all); * Returns: * Zero on success, error code on failure. */ -int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge, - const struct drm_bridge_funcs *funcs) +int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge) { int ret; @@ -1042,7 +1040,6 @@ int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge, goto out; bridge->dev = dev; - bridge->funcs = funcs; list_add_tail(&bridge->head, &dev->mode_config.bridge_list); dev->mode_config.num_bridge++; diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c index f6cf745..0309539 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -221,8 +221,9 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) hdmi_bridge->hdmi = hdmi_reference(hdmi); bridge = &hdmi_bridge->base; + bridge->funcs = &hdmi_bridge_funcs; - drm_bridge_init(hdmi->dev, bridge, &hdmi_bridge_funcs); + drm_bridge_init(hdmi->dev, bridge); return bridge; diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 72d957f..b3344c7 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c @@ -664,7 +664,8 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) return -ENOMEM; bridge->driver_private = hda; - drm_bridge_init(drm_dev, bridge, &sti_hda_bridge_funcs); + bridge->funcs = &sti_hda_bridge_funcs; + drm_bridge_init(drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder; diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 284e541..3ad319f 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -629,7 +629,8 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) return -ENOMEM; bridge->driver_private = hdmi; - drm_bridge_init(drm_dev, bridge, &sti_hdmi_bridge_funcs); + bridge->funcs = &sti_hdmi_bridge_funcs; + drm_bridge_init(drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder; diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index f1105d0..f48a436 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -906,8 +906,7 @@ extern void drm_connector_cleanup(struct drm_connector *connector); /* helper to unplug all connectors from sysfs for device */ extern void drm_connector_unplug_all(struct drm_device *dev); -extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge, - const struct drm_bridge_funcs *funcs); +extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge); extern void drm_bridge_cleanup(struct drm_bridge *bridge); extern int drm_encoder_init(struct drm_device *dev,