From patchwork Tue Jan 20 16:38:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 5670691 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 2F4339F358 for ; Tue, 20 Jan 2015 16:47:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49B2020483 for ; Tue, 20 Jan 2015 16:47:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34C8B2041C for ; Tue, 20 Jan 2015 16:47:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755427AbbATQq4 (ORCPT ); Tue, 20 Jan 2015 11:46:56 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:43027 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755420AbbATQqy (ORCPT ); Tue, 20 Jan 2015 11:46:54 -0500 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 <0NIH000NJIM4J8A0@mailout2.samsung.com>; Wed, 21 Jan 2015 01:46:52 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.123]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id CA.98.17016.B768EB45; Wed, 21 Jan 2015 01:46:52 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-c9-54be867bc2c1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 04.6A.20081.B768EB45; Wed, 21 Jan 2015 01:46:51 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NIH00K6NILOY370@mmp2.samsung.com>; Wed, 21 Jan 2015 01:46:51 +0900 (KST) From: Ajay Kumar To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: kgene.kim@samsung.com, inki.dae@samsung.com, thierry.reding@gmail.com, daniel.vetter@ffwll.ch, seanpaul@google.com, ajaynumb@gmail.com, jg1.han@samsung.com, bhushan.r@samsung.com, prashanth.g@samsung.com, Ajay Kumar Subject: [PATCH V9 02/14] drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init Date: Tue, 20 Jan 2015 22:08:43 +0530 Message-id: <1421771935-31618-3-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 2.2.0 In-reply-to: <1421771935-31618-1-git-send-email-ajaykumar.rs@samsung.com> References: <1421771935-31618-1-git-send-email-ajaykumar.rs@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42JZI2JSrVvTti/EoPk1q8WB9wdZLDa8Wchs sWztPxaLhQ/vMlvMP3KO1eLK1/dsFpPuT2CxuLzwEqtF74KrbBabHl9jtZhxfh+TxarDG9gt 5h7Mtfi5ax6LA5/H3m8LWDx2zrrL7rFgU6nH/e7jTB6bl9R79G1ZxejxeZNcAHsUl01Kak5m WWqRvl0CV8a5v3+YC+arVxy/md7AOEmxi5GTQ0LAROL2k0MsELaYxIV769m6GLk4hASWMko0 vmpjhCla/PUAK0RiOqPE9bOrmCCcCUwSLX17wKrYBLQltk2/CTZKRKCLUWLbQXWQImaBP4wS n3/tBysSFgiXmLv2OjuIzSKgKtH64j1YA6+Ah8TbOf1sEOvkJLbcegRWwyngKbHjw1VWEFsI qGbx+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JRFeprp9IUK8KYmVValF+fFFpTmpxYcYTYGu msgsJZqcD0wbeSXxhsYm5qbGppYmFiZmlkrivEr2bSFCAumJJanZqakFqUUwfUwcnFINjHP9 ihlMk3jenl5u+P3G4wqDExmPMt1vLe8qTvrrbCX66oDoIsk27+6fjCYpP72MeoN+PnjIs53D 4PizyW98/+qbMAsqXrGtz7zKcmuTUVl1XdLFR0/fT5PX5XAP9fIK7Pfy3Vb3d4LxLt52v3KD 6gcnM7b8Tpm/Y76dVcMpXi3+3ktrdjV9UmIpzkg01GIuKk4EAIkpk2fjAgAA 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, 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 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: Inki Dae Tested-by: Rahul Sharma Tested-by: Javier Martinez Canillas Tested-by: Gustavo Padovan Tested-by: Sjoerd Simons --- 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 caec5c3..4acd693 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1030,7 +1030,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. @@ -1038,8 +1037,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; @@ -1050,7 +1048,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 6902ad6..52ed2b5 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_bridge.c @@ -220,8 +220,9 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) hdmi_bridge->hdmi = 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 2ae9a9b..6cf145d 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 d032e02..74e943e 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -635,7 +635,8 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) goto err_adapt; 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 f444263..e43d9e5 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -1209,8 +1209,7 @@ extern unsigned int drm_connector_index(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,