From patchwork Tue Jul 19 11:30:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 9237647 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 3D718607DA for ; Tue, 19 Jul 2016 14:31:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E88227569 for ; Tue, 19 Jul 2016 14:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 232452766D; Tue, 19 Jul 2016 14:31:15 +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, FREEMAIL_FROM, 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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAA0C275A2 for ; Tue, 19 Jul 2016 14:31:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46C1F6E267; Tue, 19 Jul 2016 14:30:40 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from m12-16.163.com (m12-16.163.com [220.181.12.16]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D3426E676 for ; Tue, 19 Jul 2016 11:31:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=4NeXF vtlkXBcjxc33Q2wGAXnWYamOUrKmi4Z8mymZB8=; b=LNSIIBcB5RE1HyzZxnRuD t/DlOR10Y3QUGcfSiBp+5oggVR8c8kQ5Rhq8pfl4RmAAFwhoaDxncM5qs5biyCcv HrXeCdMeOR3c27MqNMgyDBBRCE7ATrFJXQXrLnI/XuEvEmGC/IS0k6zYnZ+LtCIN FyirFMVw4khzJ69SgOWdsY= Received: from localhost.localdomain.localdomain (unknown [180.110.255.208]) by smtp12 (Coremail) with SMTP id EMCowADXN79HD45Xy4Z9AQ--.45609S2; Tue, 19 Jul 2016 19:30:16 +0800 (CST) From: Wei Yongjun To: Xinliang Liu , Xinwei Kong , Chen Feng , David Airlie , Wei Yongjun , Daniel Vetter , Archit Taneja Subject: [PATCH -next] drm/hisilicon: Fix error handling of ade_power_up() Date: Tue, 19 Jul 2016 11:30:15 +0000 Message-Id: <1468927815-737-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CM-TRANSID: EMCowADXN79HD45Xy4Z9AQ--.45609S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7WryUGw4fXFy5Zw45Gw4rXwb_yoW8JF4Upr 48XrW2yrW8AayrtFW7tay8Zryavay7KFyfWrZrCwn5Zw4avr1DXwn0yFnYqFWDZrn7Kay2 yFs7G3yUuF17urDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jgMa8UUUUU= X-Originating-IP: [180.110.255.208] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbiMAir1lWBXIXdkwAAsG X-Mailman-Approved-At: Tue, 19 Jul 2016 14:30:31 +0000 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix the reset_control_deassert() fail and clk_prepare_enable() fail error handling of ade_power_up(). Signed-off-by: Wei Yongjun --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index c3707d4..e2bd1e6 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -258,18 +258,24 @@ static int ade_power_up(struct ade_hw_ctx *ctx) ret = reset_control_deassert(ctx->reset); if (ret) { DRM_ERROR("failed to deassert reset\n"); - return ret; + goto err_reset; } ret = clk_prepare_enable(ctx->ade_core_clk); if (ret) { DRM_ERROR("failed to enable ade_core_clk (%d)\n", ret); - return ret; + goto err_prepare_enable; } ade_init(ctx); ctx->power_on = true; return 0; + +err_prepare_enable: + reset_control_assert(ctx->reset); +err_reset: + clk_disable_unprepare(ctx->media_noc_clk); + return ret; } static void ade_power_down(struct ade_hw_ctx *ctx)