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: 1794791 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 E9700DF254 for ; Fri, 23 Nov 2012 11:11:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755869Ab2KWLLK (ORCPT ); Fri, 23 Nov 2012 06:11:10 -0500 Received: from mail-da0-f46.google.com ([209.85.210.46]:55430 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755839Ab2KWLLF (ORCPT ); Fri, 23 Nov 2012 06:11:05 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so2599382dak.19 for ; Fri, 23 Nov 2012 03:11:05 -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=UDGOeEdVOCX7xpCbRHhYR19hGhaUXN47/m2Zd6twocnyR5UcuTAk3/nf0Mq9i1ytKU ZS9mHPyhJoxROtp5l7935bmGx3F8nrL/q4npnydAb4tDoydAQuGMBckuWDvEtrqsZUpK c/ZAyqKf2DZrWHGkuVkheODTxJ1ug/63o2FRPS0KJ5ifciM83WF+qIC/j+NS+H7ihMI/ oPvb5Uaf5gF8d1/gX6rwnQKTzoFlYBYV3JACuh8IVHCHkehg3k+zSZdU8aQTQRcJL0Q9 ntNy0dv9UCkJE8N+v7cGiJ8wjsPddiFuBLSbqGZsKCVf185sjsD1HlvDy3+yR/Dm8UBJ uRTQ== 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: ALoCoQl2gnP58G1T41FdQj0Qpch9mS13yMooB3alajViJ2JBhTJZOoFV3TawbrQVeF5PxO9jR44c 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; }