From patchwork Mon Sep 12 09:15:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 75977 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp751780qgf; Mon, 12 Sep 2016 02:16:26 -0700 (PDT) X-Received: by 10.98.198.85 with SMTP id m82mr31747511pfg.3.1473671782681; Mon, 12 Sep 2016 02:16:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si20826193paj.25.2016.09.12.02.16.22; Mon, 12 Sep 2016 02:16:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757512AbcILJQT (ORCPT + 27 others); Mon, 12 Sep 2016 05:16:19 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38491 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752742AbcILJQM (ORCPT ); Mon, 12 Sep 2016 05:16:12 -0400 Received: by mail-wm0-f47.google.com with SMTP id 1so133008373wmz.1 for ; Mon, 12 Sep 2016 02:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OxDpMtibH32Lg9jejXV5L6Y45zo03WM9aWMAPr9mWiE=; b=aBcQfKO91PM5qIovwRUWZAuQPyulcmPEF7gtDjaWbDlP0RvdbFWqGXbFTZZCUfQ6/3 +UId1N5Dv2N/3i/uX4Ms/eRkS0cc/YvH6CbF8QNT87V322gLualYO16oQn+PF/Ycae2e ezb3EUl8klHkTKbgqdiAIPFbSIqlRyBJZRKkw= 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=OxDpMtibH32Lg9jejXV5L6Y45zo03WM9aWMAPr9mWiE=; b=CFpIJmO1cR89pl3BsnU++RHJS1zfkeXNTvF3RJly1Ax8XPcYALyaDCr1jhjZaJiMS4 yPXM+9FYuq3kKp9Qqow5DNZe7H+xsAkVyE5FG2AV5PihyBG0KWe1wdpqdEJMH/cURUT4 8sToIT2tJ6sgYPOD3v3pbO4Hqz5Y4v465BPlyDJhUNAQP/zY1YPsE6jVfsmaCGD/bMYC DLoX8j0PY31oHVnaqLICO9y0V5uv8LnGBRo1c/BfxrN0aG8GpgITSI9L2IF2FCQtnhKU A84bgPMdsXHeyO/DebRKP37BMT94cSf6n3xNEiWLkfh7polBJBtjt0RqwkX2d7YNi0tn pSjg== X-Gm-Message-State: AE9vXwMLZiIQbdpbSelATzwy3aVbRIEF62gc1f6JCq2h5lPTSmsDfeOC9bo7SFdGPbk6CaFm X-Received: by 10.194.29.7 with SMTP id f7mr13302629wjh.99.1473671770447; Mon, 12 Sep 2016 02:16:10 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:879a:6cd0:e089:f01a:f419:f17e]) by smtp.gmail.com with ESMTPSA id va3sm16939362wjb.18.2016.09.12.02.16.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Sep 2016 02:16:10 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, Joel Stanley Subject: [PATCH 5/9] clocksource/drivers/moxart: Replace panic by pr_err Date: Mon, 12 Sep 2016 11:15:43 +0200 Message-Id: <1473671747-9400-5-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473671747-9400-1-git-send-email-daniel.lezcano@linaro.org> References: <1473671747-9400-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clksrc-of code is supposed to catch the return code and fail gracefully. Don't panic on error, but print the error and exit with a relevant error code. Signed-off-by: Daniel Lezcano Acked-by: Joel Stanley --- drivers/clocksource/moxart_timer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c index cba25b7..2a8f470 100644 --- a/drivers/clocksource/moxart_timer.c +++ b/drivers/clocksource/moxart_timer.c @@ -184,8 +184,10 @@ static int __init moxart_timer_init(struct device_node *node) } else if (of_device_is_compatible(node, "aspeed,ast2400-timer")) { timer->t1_enable_val = ASPEED_TIMER1_ENABLE; timer->t1_disable_val = ASPEED_TIMER1_DISABLE; - } else - panic("%s: unknown platform\n", node->full_name); + } else { + pr_err("%s: unknown platform\n", node->full_name); + return -EINVAL; + } timer->count_per_tick = DIV_ROUND_CLOSEST(pclk, HZ);