From patchwork Thu Jul 7 08:01:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 71550 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1279004qgy; Thu, 7 Jul 2016 01:22:27 -0700 (PDT) X-Received: by 10.98.85.5 with SMTP id j5mr3076364pfb.81.1467879746855; Thu, 07 Jul 2016 01:22:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb9si3060877pab.270.2016.07.07.01.22.26; Thu, 07 Jul 2016 01:22:26 -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 S1756904AbcGGIWL (ORCPT + 30 others); Thu, 7 Jul 2016 04:22:11 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:35721 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756237AbcGGIEE (ORCPT ); Thu, 7 Jul 2016 04:04:04 -0400 Received: by mail-wm0-f44.google.com with SMTP id z126so138070242wme.0 for ; Thu, 07 Jul 2016 01:04:03 -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=DGH/MCS5ppC8xHM0SOzQqLWfgMmiT0One/n7c2w8P/Y=; b=dw46HalAmYqybjWImc67RAmUc2m44ojy9f7Go8Bb9WB/RNx85dbnS0dFB8V3RLkbj5 MrKbN+pukfKFT+R7hFyYDcAu6iUFWgTLaXNmCooxIiSrOP9s08tr55YdwAWvrNYEy9nF yIEpngT3UjJREKWvEZnEwAa0lRAVUiyboHiiw= 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=DGH/MCS5ppC8xHM0SOzQqLWfgMmiT0One/n7c2w8P/Y=; b=e2m65a1fucB0sqqymNXgNw3x1D5TwWU6xiUmqyDBtAKsRm6apOP1pWt9KMd43ffSWt jk7KNe8pVnh3A90FexgcvG8AmsLACcXKwCI2ah0M+b7iCej9egCW2d6NWM8uprng4Hx/ xuAslLb0CagCGrgWGjcEPH0eZ4wiJJorNkMqGcNHDEuhyZ4Cx3rEr6HtYWlDmQmX1j8X ga4kbbK8B2q+EB9X/rLtmJmAcg6MVzGhZlYW8JxWU0a/YyOHIXfG9AlIZH/pOrS/AE85 7yMqFXQ1CpxI5NJpotY7fnjqtt7K5WLRNpmuv6cDADSPinCE881LJQZbC6CakSrysdzj 3brw== X-Gm-Message-State: ALyK8tJAzzkaxjgPoNjGFAbbYeLCA5mLOj0gVmF6e2D+TPmzMWRHmlQENSm+5nG2MH7IjZd8 X-Received: by 10.28.45.20 with SMTP id t20mr1335238wmt.99.1467878643041; Thu, 07 Jul 2016 01:04:03 -0700 (PDT) Received: from localhost.localdomain (lft31-1-88-121-166-205.fbx.proxad.net. [88.121.166.205]) by smtp.gmail.com with ESMTPSA id v70sm51327wmf.18.2016.07.07.01.04.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 01:04:02 -0700 (PDT) From: Daniel Lezcano To: tglx@linutronix.de, daniel.lezcano@linaro.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 64/93] clocksource/drivers/zevio: Convert init function to return error Date: Thu, 7 Jul 2016 10:01:37 +0200 Message-Id: <1467878526-1238-64-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467878526-1238-1-git-send-email-daniel.lezcano@linaro.org> References: <577E0BED.3020608@linaro.org> <1467878526-1238-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 --- drivers/clocksource/zevio-timer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 diff --git a/drivers/clocksource/zevio-timer.c b/drivers/clocksource/zevio-timer.c index ceaa613..cb4cf056 100644 --- a/drivers/clocksource/zevio-timer.c +++ b/drivers/clocksource/zevio-timer.c @@ -210,9 +210,9 @@ error_free: return ret; } -static void __init zevio_timer_init(struct device_node *node) +static int __init zevio_timer_init(struct device_node *node) { - BUG_ON(zevio_timer_add(node)); + return zevio_timer_add(node); } -CLOCKSOURCE_OF_DECLARE(zevio_timer, "lsi,zevio-timer", zevio_timer_init); +CLOCKSOURCE_OF_DECLARE_RET(zevio_timer, "lsi,zevio-timer", zevio_timer_init);