From patchwork Fri Nov 23 11:04:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13138 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 192FD23FC6 for ; Fri, 23 Nov 2012 11:11:07 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id BB90BA194A8 for ; Fri, 23 Nov 2012 11:11:06 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1660847ieb.11 for ; Fri, 23 Nov 2012 03:11:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hslxmHaTT8tswuvZVRiqQcXDiuhoG76yBPLTBHOYgsg=; b=S6Psk2GI/aMNSMAdWvbvMhLZsnpjTsAoFtqlzauomhKt9Iy8JC+3GG9ZjjbOIHXld/ nDaoqMVT7xqhOoC+wcPjz1Ttb4wpZFRYVT7ppGZD8MN6kyltf1TerJL3Y7PVXBNMHO3d oJMhp3UlHSH/+Fm9I0u/hA0TxnwqbmtPCgSNSI8GeKZh5Vnxs3Bd8njewEcTNJQYgueI Au5VGKPCtATvH9jDEuj889KUHqgEBH/46g4cXNN3vRGMTz+yrDHVqwjg4dIF3FulTX3N nvB9w+oZHifuC1mDmG0MFL7dB5LRyTIswtmNgvnPvTeQEDF7SbbxiblLOVJi1zHEzVzz va0A== Received: by 10.50.161.169 with SMTP id xt9mr5694124igb.62.1353669066510; Fri, 23 Nov 2012 03:11:06 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp336297igt; Fri, 23 Nov 2012 03:11:05 -0800 (PST) Received: by 10.66.73.132 with SMTP id l4mr9507125pav.48.1353669065602; Fri, 23 Nov 2012 03:11:05 -0800 (PST) Received: from mail-da0-f52.google.com (mail-da0-f52.google.com [209.85.210.52]) by mx.google.com with ESMTPS id zz3si8200574pbc.181.2012.11.23.03.11.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:11:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f52.google.com with SMTP id f10so3529097dak.25 for ; Fri, 23 Nov 2012 03:11:05 -0800 (PST) Received: by 10.66.75.165 with SMTP id d5mr9560808paw.39.1353669065369; Fri, 23 Nov 2012 03:11:05 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id wf8sm3667394pbc.65.2012.11.23.03.11.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:11:04 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, Shaik Ameer Basha Subject: [PATCH v2 1/4] [media] exynos-gsc: Rearrange error messages for valid prints Date: Fri, 23 Nov 2012 16:34:39 +0530 Message-Id: <1353668682-13366-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353668682-13366-1-git-send-email-sachin.kamat@linaro.org> References: <1353668682-13366-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQnv86JT8LuO0tR0KdscTM3tZWekhd5i8l3pC6i7E7BdyLSfbCFdhwHnJ8kbm4b/eZ6vPO/f In case of clk_prepare failure, the function gsc_clk_get also prints "failed to get clock" which is not correct. Hence move the error messages to their respective blocks. While at it, also renamed the labels meaningfully. Cc: Shaik Ameer Basha Signed-off-by: Sachin Kamat --- drivers/media/platform/exynos-gsc/gsc-core.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 6d6f65d..45bcfa7 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1017,25 +1017,26 @@ static int gsc_clk_get(struct gsc_dev *gsc) dev_dbg(&gsc->pdev->dev, "gsc_clk_get Called\n"); gsc->clock = clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME); - if (IS_ERR(gsc->clock)) - goto err_print; + if (IS_ERR(gsc->clock)) { + dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n", + GSC_CLOCK_GATE_NAME); + goto err_clk_get; + } ret = clk_prepare(gsc->clock); if (ret < 0) { + dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", + GSC_CLOCK_GATE_NAME); clk_put(gsc->clock); gsc->clock = NULL; - goto err; + goto err_clk_prepare; } return 0; -err: - dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", - GSC_CLOCK_GATE_NAME); +err_clk_prepare: gsc_clk_put(gsc); -err_print: - dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n", - GSC_CLOCK_GATE_NAME); +err_clk_get: return -ENXIO; }