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: 1800601 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id A1CC7DF2F9 for ; Mon, 26 Nov 2012 06:26:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910Ab2KZG05 (ORCPT ); Mon, 26 Nov 2012 01:26:57 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:48914 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814Ab2KZG04 (ORCPT ); Mon, 26 Nov 2012 01:26:56 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so3568955dak.19 for ; Sun, 25 Nov 2012 22:26:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hslxmHaTT8tswuvZVRiqQcXDiuhoG76yBPLTBHOYgsg=; b=jDfC3w3rSiSJgAoq8LWmp3silJPLCeLYihObIFC2XsHucLTktna4eFTXOKswLuhqw+ CriLop/JCvpHKd5uIBI8u70SL5R3JUiBEKvM1yNVOBux43IXyITScQh4CuHCskZWwoCg AiHeim2+VOhczmoVMS4oK2g2Dc84tnQEl8HrdluEtHTeztHLNbPat/9SnayH6fDMrQOZ UcS0CE+utqcp/jVmJcyCZ+1JuexuNp5imikvtNTIXBCPdRtzr0tAwKsLVVoEI71b31ls clniHmCwjRSFIu4tRqZzPMvq8YE64U+u7HGgTChxUShuzz1MR02jUx2rQeAnGxu9StWR Ajlw== 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: ALoCoQmYVWjFJi94THnQM9sCqLYAN9kTYHRrqRJfXSl3v8eJRiMDlN5oDJcHDqz8DjGRdxX7mZK9 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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; }