Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp36825ybv; Tue, 18 Feb 2020 17:12:48 -0800 (PST) X-Google-Smtp-Source: APXvYqwmpzp/EyNHC5PXTscpp2cVQ/mupcKE16ETayhTsHeZl1xhAIZT1dtSXTWdxrrBMIgMW3BZ X-Received: by 2002:aca:4b46:: with SMTP id y67mr2930141oia.122.1582074768480; Tue, 18 Feb 2020 17:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582074768; cv=none; d=google.com; s=arc-20160816; b=u71pMQ8S4DH/W0dMsRLkslUg1tJGr1ach8yvDzfcge/TKTLEHw4xLmhRWxe2WBNgSI f38IhQDzAEvgBVra3POSyKvBVHP+7YOBqxhZnaCHsU3spZaGFfk691rXVAVQ8MmCPjVy VghZYD1bZJmR/++EYywo5r/i/lse3FxGoQfiVcRrN4C6djcHH34U+k4fRBEumoNqEJ31 quuRqGbSwOGGdQefzjqqMHJtEBP7ztjNyAba/rVWN5FC5M+Y7VucvXhKx3CuHjz8y/+X 1f/mYBJsqTJSvmnbZweBOjBBI/DJvOKJJxS8e4pxza4UPxKWjfpBqiy6jt1wJOP6LRo9 /Usw== 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=JoYnHBAG6Y5v6fA38lydAZysRIc6JyUc06Qk8jBvAUk=; b=f4zoEE8s3KMLB4oPRw4LgW/sutU0jBfupVurj9uh7rlLeueBORGOVyIu+HYXB2AbO5 Yva0mMKDcIEn9AcRLgOl6saAPClV/eEXYamBeIzpk0Z/vawVHTXWfdE/c2eIgsUm2F9s vRTEvZtxizpBamlwzml6r8GTs6ibERyrEBh5xcTyT+9o4c/hWHwrk3v0YxmRZ1kmQxSv ZlvMjXkF9cZgTvvWw3rkPf4ppRuLzbAaT+hR2gq3apBPKWMdQGJbRIOxWQyD/mxnA75t xD+o42+r2h0lwYckTqSADPak70Cv+iwtiBOKCtC3DGKB+5CIEjtFOz14YFSXhpeD3R3K uR5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@castello.eng.br header.s=default header.b=w1E4Gp6D; 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 i15si8559716oik.46.2020.02.18.17.12.36; Tue, 18 Feb 2020 17:12:48 -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=fail header.i=@castello.eng.br header.s=default header.b=w1E4Gp6D; 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 S1727789AbgBSBLe (ORCPT + 99 others); Tue, 18 Feb 2020 20:11:34 -0500 Received: from gateway24.websitewelcome.com ([192.185.51.253]:49633 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbgBSBLe (ORCPT ); Tue, 18 Feb 2020 20:11:34 -0500 X-Greylist: delayed 1393 seconds by postgrey-1.27 at vger.kernel.org; Tue, 18 Feb 2020 20:11:33 EST Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 0C3E53249 for ; Tue, 18 Feb 2020 18:48:20 -0600 (CST) Received: from br164.hostgator.com.br ([192.185.176.180]) by cmsmtp with SMTP id 4DXHjJ2qURP4z4DXHjjPhG; Tue, 18 Feb 2020 18:48:20 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=castello.eng.br; s=default; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JoYnHBAG6Y5v6fA38lydAZysRIc6JyUc06Qk8jBvAUk=; b=w1E4Gp6D/9U2l7EaNAy00GX6Jg 17Xr4eHKch+rmlP/+VeQNFjzBvy8SfbIIsRnA1R7vPNk+ign0ZNg4cBqUa1Qh0WSIKbhS5woHIAYY G4oexTma33sdm2XgXOg9I+3piUWcBU69QXNi0K1qEqprdB8A1mwcUNvyaB4KSB7UEdb2CDakCjxfo Z5RNwe1fP8CP1rgwk5F8QsUTJmIxE2Xdm/2PczWq/bDdw6se6VjEwWM/PdfgBUNmYa1eeGysnmjut XrVlPT6rQ91P7B/m6NzhNw9hHTd/vew785BKQUdKzi4gfVheSGv43gu3+GII0IlDXJotY7phCkFaA Ar4Ym6tg==; Received: from [191.31.202.255] (port=52372 helo=castello.castello) by br164.hostgator.com.br with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1j4DXG-000PIC-8O; Tue, 18 Feb 2020 21:48:18 -0300 From: Matheus Castello To: afaerber@suse.de, manivannan.sadhasivam@linaro.org Cc: daniel.lezcano@linaro.org, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Matheus Castello Subject: [PATCH v2] clocksource: owl: Improve owl_timer_init fail messages Date: Tue, 18 Feb 2020 21:48:10 -0300 Message-Id: <20200219004810.411190-1-matheus@castello.eng.br> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - br164.hostgator.com.br X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - castello.eng.br X-BWhitelist: no X-Source-IP: 191.31.202.255 X-Source-L: No X-Exim-ID: 1j4DXG-000PIC-8O X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (castello.castello) [191.31.202.255]:52372 X-Source-Auth: matheus@castello.eng.br X-Email-Count: 1 X-Source-Cap: Y2FzdGUyNDg7Y2FzdGUyNDg7YnIxNjQuaG9zdGdhdG9yLmNvbS5icg== X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check the return from clocksource_mmio_init, add messages in case of an error and in case of not having a defined clock property. Signed-off-by: Matheus Castello --- Thanks Manivannan and Andreas for the review. Tested on my Caninos Labrador s500 based board. Changes since v1: (suggested by maintainers) - Maintains consistency output PTR_ERR(clk) - Returning in case of error on clocksource_mmio_init - Use parentheses between the error code - Remove OF mention drivers/clocksource/timer-owl.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/timer-owl.c b/drivers/clocksource/timer-owl.c index 900fe736145d..820fbcc05503 100644 --- a/drivers/clocksource/timer-owl.c +++ b/drivers/clocksource/timer-owl.c @@ -135,8 +135,11 @@ static int __init owl_timer_init(struct device_node *node) } clk = of_clk_get(node, 0); - if (IS_ERR(clk)) - return PTR_ERR(clk); + if (IS_ERR(clk)) { + ret = PTR_ERR(clk); + pr_err("Failed to get clock for clocksource (%d)\n", ret); + return ret; + } rate = clk_get_rate(clk); @@ -144,8 +147,12 @@ static int __init owl_timer_init(struct device_node *node) owl_timer_set_enabled(owl_clksrc_base, true); sched_clock_register(owl_timer_sched_read, 32, rate); - clocksource_mmio_init(owl_clksrc_base + OWL_Tx_VAL, node->name, - rate, 200, 32, clocksource_mmio_readl_up); + ret = clocksource_mmio_init(owl_clksrc_base + OWL_Tx_VAL, node->name, + rate, 200, 32, clocksource_mmio_readl_up); + if (ret) { + pr_err("Failed to register clocksource (%d)\n", ret); + return ret; + } owl_timer_reset(owl_clkevt_base); -- 2.25.0