From patchwork Tue Jun 28 10:31:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 71016 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1510846qgy; Tue, 28 Jun 2016 03:37:18 -0700 (PDT) X-Received: by 10.98.68.152 with SMTP id m24mr530158pfi.35.1467110238741; Tue, 28 Jun 2016 03:37:18 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si33085456pav.216.2016.06.28.03.37.18; Tue, 28 Jun 2016 03:37:18 -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 S1752990AbcF1Kec (ORCPT + 30 others); Tue, 28 Jun 2016 06:34:32 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38604 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752938AbcF1KeZ (ORCPT ); Tue, 28 Jun 2016 06:34:25 -0400 Received: by mail-wm0-f54.google.com with SMTP id r201so20935111wme.1 for ; Tue, 28 Jun 2016 03:34:25 -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=RJMmYfVqhpiyHOZp2c7OA7SPjH2wvpQapCk3OIKKgrzkR7Xu5FhAb9sbfE28y+ttsB 0ct0gN1dmE+nPRQMRfKll5qclq5f370uv0H+EFHh13HLgqL2rhSAizvsm7B6y4YJotmj KjdGA/1bmy4CS2euFjKcATIrFBf22Eu7DPi78= 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=Dv37Dj6zB91zTvRKxRK94cupgegaBImTvJ8fGsR5OoYOEKMBkfBrG7stGmobpdz3mU dxi56fXMwmdvSoud8sDPJQk/5xcrWTS3hNF3ZYegPgyHO0Cei4u10xjP8yYAahG4x95Y p9cGWjN1pul+BC0RyHzk8hdxRX/Ufydy35o3q+V2v/r3KQTYFkIllRNNF+ApvbbCTrgK LUW3WaMPwV376jLbnuuJNPPhZP1ccU4+gWrg7E+7z9B94rF8duu1TGwYTt/zM5dQHZpu gcSWOQa3fo2hVY4JVXEDIFRWTiQNXkcuZFOljQhnQMnx2MnPQKAlbwT0HiUPGqk7xozm Bb5Q== X-Gm-Message-State: ALyK8tJUuxof50AXjSH/N9K23IapzVGRLDtd8tO80zVBmKUuIGXmqqQZmS7ZYPE0bBGYmPYI X-Received: by 10.194.192.97 with SMTP id hf1mr2619654wjc.175.1467110064277; Tue, 28 Jun 2016 03:34:24 -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 a84sm5377403wma.0.2016.06.28.03.34.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 03:34:23 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org Subject: [PATCH 64/92] clocksource/drivers/zevio: Convert init function to return error Date: Tue, 28 Jun 2016 12:31:23 +0200 Message-Id: <1467109911-11060-64-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467109911-11060-1-git-send-email-daniel.lezcano@linaro.org> References: <577251A4.7030508@linaro.org> <1467109911-11060-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);