From patchwork Sun Feb 19 16:59:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9581665 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 EF1DB60578 for ; Sun, 19 Feb 2017 17:03:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0EB828708 for ; Sun, 19 Feb 2017 17:03:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D57F52870A; Sun, 19 Feb 2017 17:03:20 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8DDD028708 for ; Sun, 19 Feb 2017 17:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=pLQzl1wgqbjyyuPuFeA7J0x4JquDWJTNbgZMna/ZbQM=; b=RyT OARRw+N40wbVe+SDqrpf2gf0+eCH05hcXH39XmqTydtO+xeSB2EmFSlsJKIFt0lpItjdoEk3uunoJ NLMtyKgE4JGflvqTLJ5TXX3Rz82EdvJgll4v+LQmbdpPifIEoy3Itb1YpiUEKFQQyuC10lSRlfUWR uosKHdLVhojBRc3X+UMZjSlidrXG+KtlNlaNlJBkSZdJjED20cu6189a4R3tXE2fb+9yJ+U8D3syN DLlkp6eqg8varBSw+zxl0j310olUcJvDs3EiwTsMKGFMxU1ZMKjQp2HDh0gLxBL9C9QkNEc/Os9U+ c8XA2rcYafPg2bQ9Jm//VlC4f5AdAQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cfUtK-0006UH-3C; Sun, 19 Feb 2017 17:03:18 +0000 Received: from smtp11.smtpout.orange.fr ([80.12.242.133] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cfUsf-0005AC-K8 for linux-rockchip@lists.infradead.org; Sun, 19 Feb 2017 17:02:41 +0000 Received: from localhost.localdomain ([92.140.226.155]) by mwinf5d22 with ME id mh1y1u00M3MnwYU03h20ij; Sun, 19 Feb 2017 18:02:13 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 19 Feb 2017 18:02:13 +0100 X-ME-IP: 92.140.226.155 From: Christophe JAILLET To: mark.yao@rock-chips.com, airlied@linux.ie, heiko@sntech.de Subject: [PATCH] drm/rockchip: cdn-dp: Fix error handling Date: Sun, 19 Feb 2017 17:59:42 +0100 Message-Id: <20170219165942.17268-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.9.3 X-Antivirus: avast! (VPS 170219-0, 19/02/2017), Outbound message X-Antivirus-Status: Clean X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170219_090238_043414_3F352FA1 X-CRM114-Status: UNSURE ( 8.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP It is likely that both 'clk_disable_unprepare()' should be called if 'pm_runtime_get_sync()' fails. Add a new label for that, because 'err_set_rate' is not meaningful in this case. Fixes: 1a0f7ed3abe2 ("drm/rockchip: cdn-dp: add cdn DP support for rk3399") Signed-off-by: Christophe JAILLET --- Not sure but a 'pm_runtime_get_sync()' is maybe also required in the 'err_set_rate' path. --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 9ab67a670885..0fe1ec8b8fb1 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -111,7 +111,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp) ret = pm_runtime_get_sync(dp->dev); if (ret < 0) { DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret); - goto err_pclk; + goto err_sync; } reset_control_assert(dp->core_rst); @@ -133,6 +133,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp) return 0; err_set_rate: +err_sync: clk_disable_unprepare(dp->core_clk); err_core_clk: clk_disable_unprepare(dp->pclk);