From patchwork Tue Jan 7 22:07:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 3450171 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2A0F39F374 for ; Tue, 7 Jan 2014 22:08:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F61D20109 for ; Tue, 7 Jan 2014 22:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BFDD20103 for ; Tue, 7 Jan 2014 22:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbaAGWIG (ORCPT ); Tue, 7 Jan 2014 17:08:06 -0500 Received: from mail-ee0-f53.google.com ([74.125.83.53]:58094 "EHLO mail-ee0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbaAGWIE (ORCPT ); Tue, 7 Jan 2014 17:08:04 -0500 Received: by mail-ee0-f53.google.com with SMTP id b57so333391eek.26 for ; Tue, 07 Jan 2014 14:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ot2jtrc22x7Tl175eHVv2bcZE51GboUEFu+qz2+vM4w=; b=XZJc9p1nAr8mJ5LJK2C2Eh8aOo02P309Vd51HxRV90clRT0raJeAsdqBEn3XwAfYkx MpT5gjA9ZkSv3tz7EVqieu820H7PcOtrfmiXGk1wDHqGAILqQXCswMYJzlEzUAM/3rPc IH7hC7HPxYeCOc8k+r471cLUDRO9dZg8VbdLwZQp7rxMq38xHbR4URvq4jkmSQ2jx/xJ xp9z2P/oOEMsr0QoGLd+pUwZdjNMvMfBmMIkBOw/7u2NCukwIWVRVq5myCE/+5Xc8FOM Aacgbs8jVJkC0ttQmfGYya3sRldcKlnqYkZw4ol5hafNO9Qx5lNwrHpY2ILZVG+A+yZM 0m7A== X-Received: by 10.14.204.135 with SMTP id h7mr10016973eeo.104.1389132482774; Tue, 07 Jan 2014 14:08:02 -0800 (PST) Received: from localhost.localdomain (89-76-41-4.dynamic.chello.pl. [89.76.41.4]) by mx.google.com with ESMTPSA id o47sm184053496eem.21.2014.01.07.14.08.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 07 Jan 2014 14:08:01 -0800 (PST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] exynos4-is: Fix error paths in probe() for !pm_runtime_enabled() Date: Tue, 7 Jan 2014 23:07:52 +0100 Message-Id: <1389132472-19245-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Ensure clk_disable() is called on error paths only when clk_enable() was previously called. This fixes following build warning: .../media-git/drivers/media/platform/exynos4-is/fimc-lite.c: In function 'fimc_lite_probe': .../media-git/drivers/media/platform/exynos4-is/fimc-lite.c:1583:1: warning: label 'err_sd' defined but not used [-Wunused-label] Reported-by: Hans Verkuil Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/fimc-core.c | 3 ++- drivers/media/platform/exynos4-is/fimc-lite.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index a7dfd07..dcbea59 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -1027,7 +1027,8 @@ static int fimc_probe(struct platform_device *pdev) return 0; err_gclk: - clk_disable(fimc->clock[CLK_GATE]); + if (!pm_runtime_enabled(dev)) + clk_disable(fimc->clock[CLK_GATE]); err_sd: fimc_unregister_capture_subdev(fimc); err_sclk: diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index 1234734..5213ff0 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c @@ -1563,7 +1563,7 @@ static int fimc_lite_probe(struct platform_device *pdev) if (!pm_runtime_enabled(dev)) { ret = clk_enable(fimc->clock); if (ret < 0) - goto err_clk_put; + goto err_sd; } fimc->alloc_ctx = vb2_dma_contig_init_ctx(dev); @@ -1579,7 +1579,8 @@ static int fimc_lite_probe(struct platform_device *pdev) return 0; err_clk_dis: - clk_disable(fimc->clock); + if (!pm_runtime_enabled(dev)) + clk_disable(fimc->clock); err_sd: fimc_lite_unregister_capture_subdev(fimc); err_clk_put: