From patchwork Fri Feb 12 15:11:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 8292581 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DFEEBC1F0D for ; Fri, 12 Feb 2016 15:14:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1ED7203F1 for ; Fri, 12 Feb 2016 15:13:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1667A203EB for ; Fri, 12 Feb 2016 15:13:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUFOg-00061t-ED; Fri, 12 Feb 2016 15:12:38 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aUFOT-0005sL-A2 for linux-arm-kernel@lists.infradead.org; Fri, 12 Feb 2016 15:12:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F3AED3A1; Fri, 12 Feb 2016 07:11:18 -0800 (PST) Received: from e104803-lin.lan (unknown [10.1.203.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 70FEF3F246; Fri, 12 Feb 2016 07:12:05 -0800 (PST) From: Andre Przywara To: Maxime Ripard , =?UTF-8?q?Emilio=20L=C3=B3pez?= , Michael Turquette , Chen-Yu Tsai Subject: [PATCH 1/3] clk: sunxi: improve mux_clk error handling and reporting Date: Fri, 12 Feb 2016 15:11:51 +0000 Message-Id: <1455289913-29514-2-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1455289913-29514-1-git-send-email-andre.przywara@arm.com> References: <1455289913-29514-1-git-send-email-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160212_071225_484551_AD443A4D X-CRM114-Status: UNSURE ( 8.74 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.0 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-sunxi@googlegroups.com, Stephen Boyd , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We now catch and report a failing ioremap, also a failure in the final step of the clock registration is now handled and reported. Also warnings are turned into errors. Signed-off-by: Andre Przywara --- drivers/clk/sunxi/clk-sunxi.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 49ce283..361f396 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -690,11 +690,15 @@ static struct clk * __init sunxi_mux_clk_setup(struct device_node *node, int i; reg = of_iomap(node, 0); + if (!reg) { + pr_err("Could not map registers for mux-clk: %s\n", node->name); + return NULL; + } i = of_clk_parent_fill(node, parents, SUNXI_MAX_PARENTS); if (of_property_read_string(node, "clock-output-names", &clk_name)) { - pr_warn("%s: could not read clock-output-names for \"%s\"\n", - __func__, clk_name); + pr_err("%s: could not read clock-output-names for \"%s\"\n", + __func__, clk_name); goto out_unmap; } @@ -704,14 +708,17 @@ static struct clk * __init sunxi_mux_clk_setup(struct device_node *node, 0, &clk_lock); if (IS_ERR(clk)) { - pr_warn("%s: failed to register mux clock %s: %ld\n", __func__, - clk_name, PTR_ERR(clk)); + pr_err("%s: failed to register mux clock %s: %ld\n", __func__, + clk_name, PTR_ERR(clk)); goto out_unmap; } - of_clk_add_provider(node, of_clk_src_simple_get, clk); + if (!of_clk_add_provider(node, of_clk_src_simple_get, clk)) + return clk; + + pr_err("%s: failed to add clock provider for %s\n", __func__, clk_name); - return clk; + clk_unregister_divider(clk); out_unmap: iounmap(reg);