From patchwork Sun Oct 25 23:21:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Klimov X-Patchwork-Id: 7484361 Return-Path: X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B8BEBEEA4 for ; Sun, 25 Oct 2015 23:22:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3FC3F207C8 for ; Sun, 25 Oct 2015 23:22:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6A68207CE for ; Sun, 25 Oct 2015 23:22:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZqUcD-00043O-HE; Sun, 25 Oct 2015 23:22:17 +0000 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZqUcB-000421-7c for linux-mediatek@lists.infradead.org; Sun, 25 Oct 2015 23:22:16 +0000 Received: by wikq8 with SMTP id q8so141553952wik.1 for ; Sun, 25 Oct 2015 16:21:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fs7dByT0spA/DtsdNxo2iVfgSqzanjM1H7hmjV41xew=; b=04E6hxvNGg8Rquxb/IIzqdNFKe+5bj6EVWPJ/pESQz4qfREFy2rCUlYHLuaARtO8Mc m5SdqNm9EGB59JkmVDDAvFs6Ln7lr4qPvQ73MRsGPCz0Wq9dyWzTu5QUbqQTwtOrdOVQ 7mE7nXL8H+F8EemVwuwfSu0JfJqHZC6PO/te7/hYn4xUhQAXXbfGep7v1R8wb6u7nJik Q7isyJJFiFTegp2FSQl+uql1rOu+BzuUk+ALkceDJC4JS24m4iVpYnl1VSL3SkX4wvFW hXktuYNj/l6keiMY23uhqrpgixdSL1WGy8cJXvrjP1vhWckvOAwZRQsSdVAPsf/l39mP lGxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fs7dByT0spA/DtsdNxo2iVfgSqzanjM1H7hmjV41xew=; b=TFXU0X/AuicBEkp5w1JBxHgAhypo3WaloBbzKIaFUqC0AC7SVmaToE9y9AQ9Er5Qmw 9OGqG9FNWs456g2/AL2EOnxrJHG1tbSf4zFsq+Qo63bXbeWjb+udYvpdBmEU5zQ5z2wl GvMOl+R1nS3Iqj8DbTIGQPovowHLyqVZ7gCTeAfefyiEuYHURUj7oeBID6ktdsDDgU9b n3+BoDylvLW8A9NCLhV+M9EfDPpot6pG04dqKPQFc14vk4l6YqMNNt0Uwi/1PJwpmaYh dvUONiggs/jw+7T61sINJIAy2QEayiCtxDiqOb2iGCZaa3U7+NSZ0uY2CSComWuJLrqd 3zLQ== X-Gm-Message-State: ALoCoQnO7QTZztCFTFpY51Jw8783QLsyjr8eH2eZ2lct0AB66au9OqtBR7UGbQ9FJ1ebXFSutHw8 X-Received: by 10.194.76.178 with SMTP id l18mr16888877wjw.75.1445815313919; Sun, 25 Oct 2015 16:21:53 -0700 (PDT) Received: from mtux.lan (host-2-101-188-230.as13285.net. [2.101.188.230]) by smtp.gmail.com with ESMTPSA id jj8sm11712633wid.2.2015.10.25.16.21.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Oct 2015 16:21:53 -0700 (PDT) From: Alexey Klimov To: daniel.lezcano@linaro.org, matthias.bgg@gmail.com, linux-kernel@vger.kernel.org, joe@perches.com Subject: [PATCH v3 2/3] clocksource: mtk_timer: fix pr_warn() messages in mtk_timer_init Date: Sun, 25 Oct 2015 23:21:23 +0000 Message-Id: <1445815284-10425-2-git-send-email-alexey.klimov@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1445815284-10425-1-git-send-email-alexey.klimov@linaro.org> References: <1445815284-10425-1-git-send-email-alexey.klimov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151025_162215_459070_A65A5120 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yingjoe.chen@mediatek.com, tglx@linutronix.de, Alexey Klimov , linux-mediatek@lists.infradead.org, klimov.linux@gmail.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1) Change pr_warn()s to pr_err()s. These messages are actually errors and not warnings. 2) Add missing \n. 3) Error message for kzalloc() failure is removed per suggestion by Joe Perches. There is generic stack_dump() for allocation issues. Signed-off-by: Alexey Klimov --- Changes in v3: -- small cleanup Changes in v2: -- remove message on allocation failure drivers/clocksource/mtk_timer.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/clocksource/mtk_timer.c b/drivers/clocksource/mtk_timer.c index ca5ea9e..4ddddf4 100644 --- a/drivers/clocksource/mtk_timer.c +++ b/drivers/clocksource/mtk_timer.c @@ -183,10 +183,8 @@ static void __init mtk_timer_init(struct device_node *node) struct clk *clk; evt = kzalloc(sizeof(*evt), GFP_KERNEL); - if (!evt) { - pr_warn("Can't allocate mtk clock event driver struct"); + if (!evt) return; - } evt->dev.name = "mtk_tick"; evt->dev.rating = 300; @@ -200,24 +198,24 @@ static void __init mtk_timer_init(struct device_node *node) evt->gpt_base = of_io_request_and_map(node, 0, "mtk-timer"); if (IS_ERR(evt->gpt_base)) { - pr_warn("Can't get resource\n"); + pr_err("Can't get resource\n"); return; } evt->dev.irq = irq_of_parse_and_map(node, 0); if (evt->dev.irq <= 0) { - pr_warn("Can't parse IRQ"); + pr_err("Can't parse IRQ\n"); goto err_mem; } clk = of_clk_get(node, 0); if (IS_ERR(clk)) { - pr_warn("Can't get timer clock"); + pr_err("Can't get timer clock\n"); goto err_irq; } if (clk_prepare_enable(clk)) { - pr_warn("Can't prepare clock"); + pr_err("Can't prepare clock\n"); goto err_clk_put; } rate = clk_get_rate(clk); @@ -226,7 +224,7 @@ static void __init mtk_timer_init(struct device_node *node) if (request_irq(evt->dev.irq, mtk_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL, "mtk_timer", evt)) { - pr_warn("failed to setup irq %d\n", evt->dev.irq); + pr_err("failed to setup irq %d\n", evt->dev.irq); goto err_clk_disable; }