From patchwork Tue Feb 14 17:01:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 9572271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B59E060578 for ; Tue, 14 Feb 2017 17:02:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97133205AF for ; Tue, 14 Feb 2017 17:02:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AFC02842F; Tue, 14 Feb 2017 17:02:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 20A3B205AF for ; Tue, 14 Feb 2017 17:02:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=swDvWpuVCrYk73NSYslVesgLfnLsQMfCXwVIMlbME4E=; b=lFdgSxlczKOPZrUd3gQZwnt4oj R/7gmGOylRysgSOgCuAWBQttA8leJi9Q9bcr2G0nS86+xp+gz7GfFv4yx0g6anPKcY+wX12RkPJSd HPx+0Nd7aiBtH8WMpHwI7Nc+nVOgSGqQP/fN84QZ04uqtgCqePXT1NU7W2dVJZF4ORPGUm1tN8d8g BcCb/quBFD2r2DOd+BtcK/p2bJSlt+QTb9UqkvVegcP9UgmfbUoL+4N+WzGV8MK9ztrdWAvEilz0B P4Sqisp0hoKhstFV/WhKoYdBPTpIpNZjnX0ELFU0Cnw8+ESrxewpmglewddLtMP5+hDab65QupbHE UfGB0LNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cdgUx-0002bp-Kr; Tue, 14 Feb 2017 17:02:39 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cdgUs-0002OL-GW for linux-arm-kernel@lists.infradead.org; Tue, 14 Feb 2017 17:02:36 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id B3DAB2055D; Tue, 14 Feb 2017 18:02:11 +0100 (CET) Received: from localhost (83.146.29.93.rev.sfr.net [93.29.146.83]) by mail.free-electrons.com (Postfix) with ESMTPSA id 8437C2076B; Tue, 14 Feb 2017 18:02:01 +0100 (CET) From: Gregory CLEMENT To: Ulf Hansson , Adrian Hunter , linux-mmc@vger.kernel.org Subject: [PATCH v6 02/14] clk: apn806: Turn the eMMC clock as optional for dts backwards compatible Date: Tue, 14 Feb 2017 18:01:42 +0100 Message-Id: <7dac8a83c938e1073c492a5168961596b54beb5d.1487091464.git-series.gregory.clement@free-electrons.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170214_090234_736857_45032C72 X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jimmy Xu , Andrew Lunn , Mike Turquette , Nadav Haklai , Ziji Hu , Victor Gu , Doug Jones , linux-clk@vger.kernel.org, Jisheng Zhang , Yehuda Yitschak , Marcin Wojtas , Kostya Porotchkin , Hanna Hawa , Sebastian Hesselbarth , devicetree@vger.kernel.org, Jason Cooper , Rob Herring , Ryan Gao , Gregory CLEMENT , "Wei\(SOCP\) Liu" , linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , Stephen Boyd , linux-kernel@vger.kernel.org, Wilson Ding MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP First version of the binding didn't have the eMMC clock. This patch allows to not registering the eMMC clock if it is not present in the device tree. Then the device tree can be backwards compatible. Suggested-by: Stephen Boyd Signed-off-by: Gregory CLEMENT --- drivers/clk/mvebu/ap806-system-controller.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/clk/mvebu/ap806-system-controller.c b/drivers/clk/mvebu/ap806-system-controller.c index 0a785076b0c6..a5459abbc314 100644 --- a/drivers/clk/mvebu/ap806-system-controller.c +++ b/drivers/clk/mvebu/ap806-system-controller.c @@ -118,13 +118,19 @@ static int ap806_syscon_clk_probe(struct platform_device *pdev) } /* eMMC Clock is fixed clock divided by 3 */ - of_property_read_string_index(np, "clock-output-names", - 4, &name); - ap806_clks[4] = clk_register_fixed_factor(NULL, name, fixedclk_name, - 0, 1, 3); - if (IS_ERR(ap806_clks[4])) { - ret = PTR_ERR(ap806_clks[4]); - goto fail4; + if (of_property_read_string_index(np, "clock-output-names", + 4, &name)) { + ap806_clk_data.clk_num--; + dev_warn(&pdev->dev, + "eMMC clock mising: update the device tree!\n"); + } else { + ap806_clks[4] = clk_register_fixed_factor(NULL, name, + fixedclk_name, + 0, 1, 3); + if (IS_ERR(ap806_clks[4])) { + ret = PTR_ERR(ap806_clks[4]); + goto fail4; + } } of_clk_add_provider(np, of_clk_src_onecell_get, &ap806_clk_data);