From patchwork Thu Jun 16 21:27:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 70252 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp467069qgy; Thu, 16 Jun 2016 14:36:20 -0700 (PDT) X-Received: by 10.107.164.202 with SMTP id d71mr11574734ioj.80.1466112603255; Thu, 16 Jun 2016 14:30:03 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n188si7982154pfn.2.2016.06.16.14.29.52; Thu, 16 Jun 2016 14:29:52 -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 S933408AbcFPV3l (ORCPT + 30 others); Thu, 16 Jun 2016 17:29:41 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:37340 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755387AbcFPV3c (ORCPT ); Thu, 16 Jun 2016 17:29:32 -0400 Received: by mail-wm0-f51.google.com with SMTP id a66so75568978wme.0 for ; Thu, 16 Jun 2016 14:29:31 -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=gJkxpK0TK/+VskAmRC7yqV9zUy82DZvs0xS3MDjQdAE=; b=DPZkqdwuzMUwoSeoouCfAwkOUNtFTnJUC2Xq+GBk/Vhh/FKV/kncFypkyNTFfiT26k nM8+DQDeuyN4jKOIh3mA/cthbGI0BAuSSncv6qGKnKTN1jefZ49hkDWIn2dD04/TFWvI tUeQt24122IrTaA2rjSc6NvZrnw2VzWw/oAPw= 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=gJkxpK0TK/+VskAmRC7yqV9zUy82DZvs0xS3MDjQdAE=; b=KYf6a7CjZn1K62I7617nmPunyIkRx6NUgUVFxwRmIXaAgWRi7gsE83+28rSgNAJt/d ser80k8cozKoVcZ3zYNIf5qIBtKMv3JfrEwhay2sbHlj1mmCdnwlD1MuEf1RMZqlmUro XhrKl2zUgU8SqevvZaZ5ulth0YtZ+9qDjq18BA5+3S8aPXSvPNwIx+ENIO4aCdsjOigD BS5ee9UWrqDnANtTzGja1HqnL82Tr9OoHvNWJgeWxFg6/S7uCxjjaF/iMphKKJSmA7IT TFbH8lMj64y6cahr0byqWVfmMI14PaoQyIWzYLDMo7Go6WYX63e3Jx/JfPwB9hF/l3Ly qRIg== X-Gm-Message-State: ALyK8tL7hQqzJ/R24QCIkyf4ipLlPfxBBufS4D2Iqzo+/sYuBT0RxeyCH2AN5g11z3GXmqtj X-Received: by 10.194.95.74 with SMTP id di10mr1519435wjb.52.1466112570687; Thu, 16 Jun 2016 14:29:30 -0700 (PDT) Received: from localhost.localdomain (sju31-1-78-210-255-2.fbx.proxad.net. [78.210.255.2]) by smtp.gmail.com with ESMTPSA id x128sm16705606wmf.6.2016.06.16.14.29.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 16 Jun 2016 14:29:30 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Russell King , Viresh Kumar , Marc Gonzalez , Felipe Balbi , linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT) Subject: [PATCH V2 59/63] clocksource/drivers/smp_twd: Convert init function to return error Date: Thu, 16 Jun 2016 23:27:18 +0200 Message-Id: <1466112442-31105-60-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466112442-31105-1-git-send-email-daniel.lezcano@linaro.org> References: <1466112442-31105-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 init functions do not return any error. They behave as the following: - panic, thus leading to a kernel crash while another timer may work and make the system boot up correctly or - print an error and let the caller unaware if the state of the system Change that by converting the init functions to return an error conforming to the CLOCKSOURCE_OF_RET prototype. Proper error handling (rollback, errno value) will be changed later case by case, thus this change just return back an error or success in the init function. Signed-off-by: Daniel Lezcano --- arch/arm/kernel/smp_twd.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 1bfa7a7..2b24be4 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -390,7 +390,7 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt) } #ifdef CONFIG_OF -static void __init twd_local_timer_of_register(struct device_node *np) +static int __init twd_local_timer_of_register(struct device_node *np) { int err; @@ -410,8 +410,9 @@ static void __init twd_local_timer_of_register(struct device_node *np) out: WARN(err, "twd_local_timer_of_register failed (%d)\n", err); + return err; } -CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register); -CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register); -CLOCKSOURCE_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register); +CLOCKSOURCE_OF_DECLARE_RET(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register); +CLOCKSOURCE_OF_DECLARE_RET(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register); +CLOCKSOURCE_OF_DECLARE_RET(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register); #endif