From patchwork Fri Nov 23 04:44:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13112 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 3167A23E13 for ; Fri, 23 Nov 2012 04:51:27 +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 D8AB0A187B3 for ; Fri, 23 Nov 2012 04:51:26 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1372021ieb.11 for ; Thu, 22 Nov 2012 20:51:26 -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=iQEsY7zRwvg3qe9wT/3BCS+Vr1vnPNAodH5yv3eBU4XRnn81nKoiwNHX0Kr8JmjfRK aaSIGeLKxBXuYHh/as4Id58B+leene8D4QYbM6xNbmzGKlRKXhj7x5e4DsDdyrEVsqgh LtC2al2FjeB2sz6040knI0xGs00nG0W9RuuTsKV4T/3JXII4+Mfukip9/XkFsg48lpYS wlbKPDwMAZc6+1SnfqAScyusWnS6Z0G9Mf3wIs5jGkLACUstF2lQYBwo3S6ahS76UwJq vAxz0k2nticUj7OCrbroIxSZ9R5XQ6OyyPF0dqopJ3B/GZ4qlxaDNlVI/x4iVRm4ocHC 9msw== Received: by 10.50.187.197 with SMTP id fu5mr2402831igc.70.1353646286302; Thu, 22 Nov 2012 20:51:26 -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 n20csp301267igt; Thu, 22 Nov 2012 20:51:25 -0800 (PST) Received: by 10.68.194.6 with SMTP id hs6mr10969181pbc.77.1353646285754; Thu, 22 Nov 2012 20:51:25 -0800 (PST) Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by mx.google.com with ESMTPS id uq10si7418629pbc.227.2012.11.22.20.51.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 20:51:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.44 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.44; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.44 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-pb0-f44.google.com with SMTP id uo1so5971311pbc.3 for ; Thu, 22 Nov 2012 20:51:25 -0800 (PST) Received: by 10.68.189.138 with SMTP id gi10mr10708715pbc.165.1353646285451; Thu, 22 Nov 2012 20:51:25 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x8sm3029746paw.16.2012.11.22.20.51.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 20:51:24 -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 1/4] [media] exynos-gsc: Rearrange error messages for valid prints Date: Fri, 23 Nov 2012 10:14:59 +0530 Message-Id: <1353645902-7467-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353645902-7467-1-git-send-email-sachin.kamat@linaro.org> References: <1353645902-7467-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmKOVp5OGhE0sfst2lc59fx7sBDmHs7DeJYSHGsx8hqO9trA4wwvI7zUUbbSr8Qb6oJO7pF 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; }