Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4060573ima; Mon, 4 Feb 2019 09:31:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IZe3B5BgsWExnt5FAUgAhVQVX3s+GgX99+TGsrc6AC8nXIUjXpC3EBN6vFyl8KsLU9EPnh8 X-Received: by 2002:a17:902:981:: with SMTP id 1mr511958pln.142.1549301488646; Mon, 04 Feb 2019 09:31:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549301488; cv=none; d=google.com; s=arc-20160816; b=jo7CxIwQq9/JjySU1BXJI+EtTNTQ9SV68HmZFOPgwu9x8cNn5SAHgQyqKhL1kHWPBV 9Prv05WME2yY6oL2TTEzVPJ8NMD9qe97sf8IGoxoOH101O88xf8+mlBg3EwsTp4TGVCp wzY12paKoB8Aa8R8i2hI2y4Ra63zC4ute5d3W7dR6/zO632L/4tNlJi0o/cEA/CW0dM9 ztKgoKBV3BerENzt/Yp+zzTqCCscLSVcQa1iCNgLuu5T9SPRsGbg7Vo7JWJWiIQU1t94 lDjeEV3uH7V2FWqv0lxOWiP+hcFPZcCqVPwi/MkWRKmjMwLCoYDnwHM/EmYn46qwr/PG JanQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uiGnEol1xb8eg2WyQOwKJAR2Kls/0Ww5rrtoxvIkC3A=; b=gb2eR8Ed/I7tDcyRUf4WVz66lj4xpjaQHM8cX6nffrtVS1Ix1RS6GPSN68MBK8j+iY zRnxRaRe+6lHvcEShrLbgUnTdl1R2b/lj+quZ6BUi4yvGTUIOGRIqtabK2TZlHhwgd+x 9cVjpjfBkGRzlSi4H8vaKMJGrg7p6KuNOHPD+q/nkFU3e2QPb/NsmmTYdCkdtvizSoNr xTdoVqZIb+hj3GEM/kNSSWUzWLZaEVyN3ZZjQuTrf88e5JHxLbdzBQb7DMrxzyvCwFBm Uk3ZEdU6pUp/VfuG+cQgUE83p2vhIDH6Zl5TPCgTq3+HcSZslaZ6wrUaw37/ZM7iRra8 HB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=SWdroQFz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f17si501345pff.171.2019.02.04.09.31.11; Mon, 04 Feb 2019 09:31:28 -0800 (PST) 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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=SWdroQFz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730397AbfBDRTQ (ORCPT + 99 others); Mon, 4 Feb 2019 12:19:16 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36830 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728437AbfBDRSO (ORCPT ); Mon, 4 Feb 2019 12:18:14 -0500 Received: by mail-wr1-f65.google.com with SMTP id z3so705540wrv.3 for ; Mon, 04 Feb 2019 09:18:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uiGnEol1xb8eg2WyQOwKJAR2Kls/0Ww5rrtoxvIkC3A=; b=SWdroQFzRrdFrWEhLuoSnZU37ILREFByTnNCmuTdI91viuSwP0ux0aMkZyVOgeDUFd JMlzkiZGfC9hDqjo5ase58BXG2GMhnKKvXuokBFG+ngtVxq6CMf/4W0Jfq3KMNN9ItIy 5cRA1dyWrHZz6tLW9jMFHUJcdJhpqv8A28TPg3qSjWNfbTDq6almeq3PMoqr3GWiCn/9 GJjE8elcAgUseOWa9Saw1k2ilqLj96CqwBcDJh28eh8EYbW079wmXTVq3d0vlZBWpKg5 0o3AwPt+KyYCwQGn9glsDsQFDmdvYtd1j/MnusV+9o8uQCumgKM++yfCpxljYrw0m5DC YLOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uiGnEol1xb8eg2WyQOwKJAR2Kls/0Ww5rrtoxvIkC3A=; b=F2od8WBIh405JzvugCBBduBAXOeWrQfKjjOmXIIcC4TSWlF7tclnWNodQe5g+bkYs6 SRkFHo+5CPfgiivU3wzilapAS7YzlVZcnVG6WieMsBPzME/Jyr5IuHsnmX62+yXyEofY u42L7aaruqnSjEy+W94cktI58GnUdXIcKlE4finw/3slituegtjMDN5MZVhfMaxU85fY 9uO0g23W1+sU3VrzMs6ul0c7Dgfp87x3yRG8NDFr4WMtZpQjJew2WjeAigNL7fBWmDYc 5Zk03HFLfVOsY82DqAlazvlapEuU5LMGMGAZhfEwmVPW/EvGxxHiEEu3JhrJ8iH9JuVC Iwfw== X-Gm-Message-State: AHQUAubxkOZfA8WBQZz+LZajdmb5qS7XJ4Ba1Ob0dOQ1OPQ3EwhQZVjs WRhb+EyveAGZaHoKPRPSHpi9Uw== X-Received: by 2002:adf:ba8e:: with SMTP id p14mr332239wrg.230.1549300691717; Mon, 04 Feb 2019 09:18:11 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-8-223.w90-86.abo.wanadoo.fr. [90.86.125.223]) by smtp.gmail.com with ESMTPSA id q9sm11197506wrv.26.2019.02.04.09.18.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 09:18:11 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Daniel Lezcano , Rob Herring , Mark Rutland , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 04/12] ARM: davinci: WARN_ON() if clk_get() fails Date: Mon, 4 Feb 2019 18:17:49 +0100 Message-Id: <20190204171757.32073-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204171757.32073-1-brgl@bgdev.pl> References: <20190204171757.32073-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Currently the timer code checks if the clock pointer passed to it is good (!IS_ERR(clk)). The new clocksource driver expects the clock to be functional and doesn't perform any checks so emit a warning if clk_get() fails. Apply this to all davinci platforms. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/da830.c | 4 ++++ arch/arm/mach-davinci/da850.c | 4 ++++ arch/arm/mach-davinci/dm355.c | 4 ++++ arch/arm/mach-davinci/dm365.c | 4 ++++ arch/arm/mach-davinci/dm644x.c | 4 ++++ arch/arm/mach-davinci/dm646x.c | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c index 2cc9fe4c3a91..9a4b749cbb6b 100644 --- a/arch/arm/mach-davinci/da830.c +++ b/arch/arm/mach-davinci/da830.c @@ -834,6 +834,10 @@ void __init da830_init_time(void) da830_pll_init(NULL, pll, NULL); clk = clk_get(NULL, "timer0"); + if (WARN_ON(IS_ERR(clk))) { + pr_err("Unable to get the timer clock\n"); + return; + } davinci_timer_init(clk); } diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index e7b78df2bfef..beb34ee42e3a 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -774,6 +774,10 @@ void __init da850_init_time(void) da850_pll0_init(NULL, pll0, cfgchip); clk = clk_get(NULL, "timer0"); + if (WARN_ON(IS_ERR(clk))) { + pr_err("Unable to get the timer clock\n"); + return; + } davinci_timer_init(clk); } diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index 4c6e0bef4509..2a523fa7c716 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -745,6 +745,10 @@ void __init dm355_init_time(void) dm355_psc_init(NULL, psc); clk = clk_get(NULL, "timer0"); + if (WARN_ON(IS_ERR(clk))) { + pr_err("Unable to get the timer clock\n"); + return; + } davinci_timer_init(clk); } diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 01fb2b0c82de..68bd78dac293 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -786,6 +786,10 @@ void __init dm365_init_time(void) dm365_psc_init(NULL, psc); clk = clk_get(NULL, "timer0"); + if (WARN_ON(IS_ERR(clk))) { + pr_err("Unable to get the timer clock\n"); + return; + } davinci_timer_init(clk); } diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 38f92b7d413e..070660cfd93a 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -681,6 +681,10 @@ void __init dm644x_init_time(void) dm644x_psc_init(NULL, psc); clk = clk_get(NULL, "timer0"); + if (WARN_ON(IS_ERR(clk))) { + pr_err("Unable to get the timer clock\n"); + return; + } davinci_timer_init(clk); } diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 7dc54b2a610f..73a0f0226017 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c @@ -665,6 +665,10 @@ void __init dm646x_init_time(unsigned long ref_clk_rate, dm646x_psc_init(NULL, psc); clk = clk_get(NULL, "timer0"); + if (WARN_ON(IS_ERR(clk))) { + pr_err("Unable to get the timer clock\n"); + return; + } davinci_timer_init(clk); } -- 2.20.1