From patchwork Mon Dec 23 03:32:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Emilio_L=C3=B3pez?= X-Patchwork-Id: 3395371 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ED875C0D4A for ; Mon, 23 Dec 2013 04:13:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3320620569 for ; Mon, 23 Dec 2013 04:13:24 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FD3820562 for ; Mon, 23 Dec 2013 04:13:23 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VuwJb-0006kR-BH; Mon, 23 Dec 2013 03:36:25 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VuwIg-0008Cw-Tz; Mon, 23 Dec 2013 03:35:26 +0000 Received: from yotta.elopez.com.ar ([31.220.24.173]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VuwHU-00086g-QL for linux-arm-kernel@lists.infradead.org; Mon, 23 Dec 2013 03:34:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=elopez.com.ar; s=mail; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=+J32xZZXVJtNPAUYYiNl5usL4S9Mf9KODPBEV6L91os=; b=INgek9gioAV15Nhp1McvkxYrEolJTyk2OgpJR6Z3mVF1p1+sjMKNi5LYFPlqfVl6YKYlB3pJ5DKalusUpOJ/P3MlPIM/0zpVQeM3XPCpZ7PwYHB5jaJxV29/N7VrGVUxJUlMDCYsPhgx211qMDdqO70Z/luXcs3M2dCwROONK2h2Ybus8lq6c6cpQaqcIP5lYVjZMP6ldzq41es7XpGwSq8rBXQzc3Yj0cu6Mn9z7E5A/GHxAmdXKWGNgT7hv7YSadTr+G4sq5aGNkeNj9jHE0DXsv/75XSQOCevkzvC5/rC98zfgu7hfVGzUykeBrH6E9Jn9RF8Vy1ULvaGaMnDQw==; Received: from [181.164.111.231] (helo=desktop.lan) by yotta.elopez.com.ar with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.82) id 1VuwHC-0004Ey-1z; Mon, 23 Dec 2013 00:33:54 -0300 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= To: Mike Turquette , Maxime Ripard Subject: [PATCH v3 09/13] clk: sunxi: support better factor DT nodes Date: Mon, 23 Dec 2013 00:32:40 -0300 Message-Id: <1387769564-12894-10-git-send-email-emilio@elopez.com.ar> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1387769564-12894-1-git-send-email-emilio@elopez.com.ar> References: <1387769564-12894-1-git-send-email-emilio@elopez.com.ar> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131222_223413_073649_4EC2125E X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) Cc: =?UTF-8?q?Emilio=20L=C3=B3pez?= , Hans de Goede , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 The DT nodes should look like abc_clk: clk@deadbeef { ... clock-output-names = "abc"; } But our old DT nodes look like abc: abc@deadbeef { ... } So, let's support both formats, until we can transition everything to the new, correct one. Signed-off-by: Emilio López --- drivers/clk/sunxi/clk-sunxi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c index 3497a29..2be4e46 100644 --- a/drivers/clk/sunxi/clk-sunxi.c +++ b/drivers/clk/sunxi/clk-sunxi.c @@ -435,6 +435,15 @@ static struct clk * __init sunxi_factors_clk_setup(struct device_node *node, (parents[i] = of_clk_get_parent_name(node, i)) != NULL) i++; + /* Nodes should be providing the name via clock-output-names + * but originally our dts didn't, and so we used node->name. + * The new, better nodes look like clk@deadbeef, so we pull the + * name just in this case */ + if (!strcmp("clk", clk_name)) { + of_property_read_string_index(node, "clock-output-names", + 0, &clk_name); + } + factors = kzalloc(sizeof(struct clk_factors), GFP_KERNEL); if (!factors) return NULL;