From patchwork Mon Nov 26 06:20:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13195 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 C723423FCD for ; Mon, 26 Nov 2012 06:26:57 +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 664CFA1934C for ; Mon, 26 Nov 2012 06:26:57 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so4098190ieb.11 for ; Sun, 25 Nov 2012 22:26:57 -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=AmGjX7C/5GW+wa9hQGwd4hPaP1EqjEYkr4j9zW4jq8Xs89aTHO6/fPPQjgsPBadrsF Yp1RrMB7wTS7uUJ0u4dnDjxwvWNErwwyxIFs2ptjUibmMx6lvt5pYbm+CqXlEPHDkuF3 rj83ts8pye6UPNPHJS3eAF99VZGJIfYvgk7zxKYyxjOQp0nXVfyvPSPB2l0/ObWDn9RW f1FIsZZK6gCPTrqSFRdDB5QVsG4txQpn1BC+34OVAAoNVUgS2SncO6ikEwYlsq1y7zOF wosnqOM2UiA+IDn+DkyKv+2YWiR0HqTHVAZTMTkGV9EaZbsTizjhDImSmuWUPssorOCX 0Rdg== Received: by 10.50.173.34 with SMTP id bh2mr9935377igc.70.1353911217106; Sun, 25 Nov 2012 22:26:57 -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 n20csp209050igt; Sun, 25 Nov 2012 22:26:56 -0800 (PST) Received: by 10.66.83.201 with SMTP id s9mr29922815pay.74.1353911216413; Sun, 25 Nov 2012 22:26:56 -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 g1si619299paw.303.2012.11.25.22.26.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2012 22:26:56 -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 f10so4269050dak.25 for ; Sun, 25 Nov 2012 22:26:56 -0800 (PST) Received: by 10.68.209.230 with SMTP id mp6mr34551239pbc.8.1353911216186; Sun, 25 Nov 2012 22:26:56 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id o1sm8215060paz.34.2012.11.25.22.26.50 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 25 Nov 2012 22:26:55 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: shaik.ameer@samsung.com, sylvester.nawrocki@gmail.com, s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH v2 1/3] [media] exynos-gsc: Rearrange error messages for valid prints Date: Mon, 26 Nov 2012 11:50:19 +0530 Message-Id: <1353910821-21408-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353910821-21408-1-git-send-email-sachin.kamat@linaro.org> References: <1353910821-21408-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmqyoS+egu6XLmzGMEtWSi3aznrkkEgpMQO+EQnx8XyaNy6lxInLiiGaPueJ61G6KJEyDRY 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; }