From patchwork Tue Jul 14 09:28:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinwei Kong X-Patchwork-Id: 6785951 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 868D99F38C for ; Tue, 14 Jul 2015 09:57:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 330672076E for ; Tue, 14 Jul 2015 09:57:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2A738204D9 for ; Tue, 14 Jul 2015 09:57:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A46206E9E4; Tue, 14 Jul 2015 02:57:06 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1679 seconds by postgrey-1.34 at gabe; Tue, 14 Jul 2015 02:57:05 PDT Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id 855846E9E4 for ; Tue, 14 Jul 2015 02:57:05 -0700 (PDT) Received: from 172.24.2.119 (EHLO szxeml431-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id BJH20794; Tue, 14 Jul 2015 17:28:51 +0800 (CST) Received: from [127.0.0.1] (10.46.126.142) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.158.1; Tue, 14 Jul 2015 17:28:40 +0800 Message-ID: <55A4D648.6060404@hisilicon.com> Date: Tue, 14 Jul 2015 17:28:40 +0800 From: Xinwei Kong User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: , , , , Subject: [PATCH 1/1] drm/sti: fix master bind bug for using component X-Originating-IP: [10.46.126.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.55A4D655.00EC, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 42b1f2c991a4a137ccfd52cadcb4affe Cc: kong.kongxinwei@hisilicon.com, liguozhu@hisilicon.com 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=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Xinwei Kong This patch fix one bug which it can't call .bind function in sti_hdmi.c and sti_hda.c file when changing the building sequence (sti_hdmi.o?sti_hda.o) in Makefile file. This patch can prepare it. Signed-off-by: Xinwei Kong --- drivers/gpu/drm/sti/sti_tvout.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index 5cc5311..293dfae 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -683,7 +683,22 @@ static int compare_of(struct device *dev, void *data) static int sti_tvout_master_bind(struct device *dev) { - return 0; + struct sti_tvout *tvout = dev_get_drvdata(dev); + struct drm_device *drm_dev; + int ret; + + if (!tvout->drm_dev) { + DRM_ERROR("master bind is fail\n"); + return 0; + } + + drm_dev = tvout->drm_dev; + + ret = component_bind_all(dev, drm_dev); + if (ret) + sti_tvout_destroy_encoders(tvout); + + return ret; } static void sti_tvout_master_unbind(struct device *dev)