From patchwork Tue Sep 15 10:23:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 7183531 Return-Path: X-Original-To: patchwork-linux-sh@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 24067BEEC1 for ; Tue, 15 Sep 2015 10:23:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E0C1206E9 for ; Tue, 15 Sep 2015 10:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53CD5206E5 for ; Tue, 15 Sep 2015 10:23:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbbIOKXa (ORCPT ); Tue, 15 Sep 2015 06:23:30 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35030 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062AbbIOKX3 (ORCPT ); Tue, 15 Sep 2015 06:23:29 -0400 Received: by pacfv12 with SMTP id fv12so176548007pac.2; Tue, 15 Sep 2015 03:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=BYYoVWEPktwq/88GEHHPuucNiVXl8pnX1wZoBDb7fEY=; b=QXTwWN6SmEDjdXvwQGLd497kpkcfffkbXl+ni9tNlLWUi2CdPq9D/INycmm/ilokvZ +tJefTGikw4IKDyPTB0Qdor1buu8nw/30iTaI/RAHxMSFXNlNFTbJTGQxBGf/dJYLs1q EZPQ4l31W99x6Nue+7cpMTJjzK0F021R6EUEPTA7xvjaPLoScU7WXMNFKixbQKV6jhDV idYBobZuNHu9Imm1FCGWGK9ECSeJ4Zu6JGofkHL94bh8h2uY/hf3BbsCxjh4CwFLc8Nk OAxljb++49YFWeocY6oyucyVPfYzY8di2I4KguiHf4XYR7FLXj6SGQPDHjFSnguEoZ5Q ebCA== X-Received: by 10.67.22.99 with SMTP id hr3mr45503400pad.41.1442312609007; Tue, 15 Sep 2015 03:23:29 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id vw7sm21292441pab.15.2015.09.15.03.23.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 03:23:28 -0700 (PDT) From: Magnus Damm To: linux-clk@vger.kernel.org Cc: linux-sh@vger.kernel.org, mturquette@baylibre.com, sboyd@codeaurora.org, horms@verge.net.au, geert@linux-m68k.org, laurent.pinchart@ideasonboard.com, Magnus Damm Date: Tue, 15 Sep 2015 19:23:26 +0900 Message-Id: <20150915102326.15716.63028.sendpatchset@little-apple> In-Reply-To: <20150915102238.15716.91170.sendpatchset@little-apple> References: <20150915102238.15716.91170.sendpatchset@little-apple> Subject: [PATCH 05/05][RFC] clk: fixed-factor: Make use of parent array Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Magnus Damm Extend the fixed-factor-clock code to use the parent array to pass in the parent clock instead of relying on string lookup. This replaces of_clk_get_parent_name() with of_clk_get() which makes it possible to use a parent clock from a shared DT node with multiple clock-indices and without clock-output-names. Signed-off-by: Magnus Damm --- drivers/clk/clk-fixed-factor.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0006/drivers/clk/clk-fixed-factor.c +++ work/drivers/clk/clk-fixed-factor.c 2015-09-15 18:28:33.410513000 +0900 @@ -8,6 +8,7 @@ * Standard functionality for the common clock API. */ #include +#include #include #include #include @@ -120,10 +121,11 @@ EXPORT_SYMBOL_GPL(clk_register_fixed_fac */ void __init of_fixed_factor_clk_setup(struct device_node *node) { - struct clk *clk; + struct clk *clk, *parent; const char *clk_name = node->name; - const char *parent_name; + const char *parent_name = NULL; u32 div, mult; + struct clk_init_data init = {}; if (of_property_read_u32(node, "clock-div", &div)) { pr_err("%s Fixed factor clock <%s> must have a clock-div property\n", @@ -138,10 +140,14 @@ void __init of_fixed_factor_clk_setup(st } of_property_read_string(node, "clock-output-names", &clk_name); - parent_name = of_clk_get_parent_name(node, 0); + parent = of_clk_get(node, 0); + + init.name = clk_name; + init.parents = &parent; + init.parent_names = &parent_name; + + clk = clk_register_fixed_factor_init(NULL, &init, mult, div); - clk = clk_register_fixed_factor(NULL, clk_name, parent_name, 0, - mult, div); if (!IS_ERR(clk)) of_clk_add_provider(node, of_clk_src_simple_get, clk); }