From patchwork Tue Sep 15 10:23:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 7183521 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 00B279F380 for ; Tue, 15 Sep 2015 10:23:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B82D206E5 for ; Tue, 15 Sep 2015 10:23:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 947E5206EE for ; Tue, 15 Sep 2015 10:23:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751721AbbIOKXX (ORCPT ); Tue, 15 Sep 2015 06:23:23 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33125 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751753AbbIOKXU (ORCPT ); Tue, 15 Sep 2015 06:23:20 -0400 Received: by pacex6 with SMTP id ex6so173502779pac.0; Tue, 15 Sep 2015 03:23:19 -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=7tkkPG9erzBIcxLNvwBMpoIuXwtuRYfWKMmp58MJmN4=; b=wmPbNwZiK/fAbx+bmosGEiZOELMIOu2fnMF1JweevLDafOg/FhhC7WVL8IrTqcXbco P/G1QGHxdNYZFXBtzpxo9B68kXH93oSJiCa53koK2CWWJ/OhLiK5aaRnTysytFSGan01 gewY+1pW1qqkpLcI8c0sXaee5rLFE0nJq112pA3Bfrr4Gc3m0baKBptlaqJD4VkXDAYR oU92LUWZPFUTlm4rkogt8VidOIkgdK2qYkQ+cPiDGlUqEjdfbqeCqvhMWXd66FZ+csNf MdEkCbJTEyv0z00PR9JJusWkpTbzKZMoY9+oZ7KFTw+SRxjRhqEliyGpjdfRVTO/63Kj Trxg== X-Received: by 10.66.219.195 with SMTP id pq3mr45449721pac.98.1442312599840; Tue, 15 Sep 2015 03:23:19 -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 qp5sm21237385pbc.0.2015.09.15.03.23.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 03:23:19 -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:16 +0900 Message-Id: <20150915102316.15716.14756.sendpatchset@little-apple> In-Reply-To: <20150915102238.15716.91170.sendpatchset@little-apple> References: <20150915102238.15716.91170.sendpatchset@little-apple> Subject: [PATCH 04/05][RFC] clk: fixed-factor: Pass struct clk_init_data 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 Break out a function named clk_register_fixed_factor_init() that takes a struct clk_init_data pointer that may or may not contain a populated parent array. Useful for SoC-specific clock drivers that want to pass an populated parent array during clock registration. Signed-off-by: Magnus Damm --- drivers/clk/clk-fixed-factor.c | 32 ++++++++++++++++++++++---------- include/linux/clk-provider.h | 4 ++++ 2 files changed, 26 insertions(+), 10 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 --- 0003/drivers/clk/clk-fixed-factor.c +++ work/drivers/clk/clk-fixed-factor.c 2015-09-14 21:51:21.600513000 +0900 @@ -70,12 +70,12 @@ const struct clk_ops clk_fixed_factor_op }; EXPORT_SYMBOL_GPL(clk_fixed_factor_ops); -struct clk *clk_register_fixed_factor(struct device *dev, const char *name, - const char *parent_name, unsigned long flags, - unsigned int mult, unsigned int div) +struct clk *clk_register_fixed_factor_init(struct device *dev, + struct clk_init_data *init, + unsigned int mult, + unsigned int div) { struct clk_fixed_factor *fix; - struct clk_init_data init = {}; struct clk *clk; fix = kmalloc(sizeof(*fix), GFP_KERNEL); @@ -85,13 +85,11 @@ struct clk *clk_register_fixed_factor(st /* struct clk_fixed_factor assignments */ fix->mult = mult; fix->div = div; - fix->hw.init = &init; + fix->hw.init = init; - init.name = name; - init.ops = &clk_fixed_factor_ops; - init.flags = flags | CLK_IS_BASIC; - init.parent_names = &parent_name; - init.num_parents = 1; + init->ops = &clk_fixed_factor_ops; + init->flags |= CLK_IS_BASIC; + init->num_parents = 1; clk = clk_register(dev, &fix->hw); @@ -100,6 +98,20 @@ struct clk *clk_register_fixed_factor(st return clk; } +EXPORT_SYMBOL_GPL(clk_register_fixed_factor_init); + +struct clk *clk_register_fixed_factor(struct device *dev, const char *name, + const char *parent_name, unsigned long flags, + unsigned int mult, unsigned int div) +{ + struct clk_init_data init = {}; + + init.name = name; + init.flags = flags; + init.parent_names = &parent_name; + + return clk_register_fixed_factor_init(dev, &init, mult, div); +} EXPORT_SYMBOL_GPL(clk_register_fixed_factor); #ifdef CONFIG_OF --- 0004/include/linux/clk-provider.h +++ work/include/linux/clk-provider.h 2015-09-14 21:51:34.000513000 +0900 @@ -484,6 +484,10 @@ struct clk_fixed_factor { }; extern const struct clk_ops clk_fixed_factor_ops; +struct clk *clk_register_fixed_factor_init(struct device *dev, + struct clk_init_data *init, + unsigned int mult, + unsigned int div); struct clk *clk_register_fixed_factor(struct device *dev, const char *name, const char *parent_name, unsigned long flags, unsigned int mult, unsigned int div);