From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 31 Aug 2017 15:01:20 +0800 From: Shawn Guo To: "A.s. Dong" Cc: Stephen Boyd , Michael Turquette , "linux-clk@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Shawn Guo Subject: Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL Message-ID: <20170831070118.GA3328@dragon> References: <1502243442-28055-1-git-send-email-shawnguo@kernel.org> <20170809173318.GD2146@codeaurora.org> <20170813141851.GD31819@dragon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-ID: On Wed, Aug 30, 2017 at 03:31:38PM +0000, A.s. Dong wrote: > IMHO how about implement a of_clk_bulk_get() to handle this issue as we already > have a of_clk_get? > e.g. > > int __must_check of_clk_bulk_get(struct device_node *np, int num_clks, > struct clk_bulk_data *clks) > { > for (i = 0; i < num_clks; i++) { > clks[i].clk = of_clk_get(dev, clks[i].id); The of_clk_get() takes clock index rather than name/id as the second parameter. Shawn > ... > > } From mboxrd@z Thu Jan 1 00:00:00 1970 From: shawnguo@kernel.org (Shawn Guo) Date: Thu, 31 Aug 2017 15:01:20 +0800 Subject: [PATCH] clk: bulk: call of_clk_get() when id is NULL In-Reply-To: References: <1502243442-28055-1-git-send-email-shawnguo@kernel.org> <20170809173318.GD2146@codeaurora.org> <20170813141851.GD31819@dragon> Message-ID: <20170831070118.GA3328@dragon> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Aug 30, 2017 at 03:31:38PM +0000, A.s. Dong wrote: > IMHO how about implement a of_clk_bulk_get() to handle this issue as we already > have a of_clk_get? > e.g. > > int __must_check of_clk_bulk_get(struct device_node *np, int num_clks, > struct clk_bulk_data *clks) > { > for (i = 0; i < num_clks; i++) { > clks[i].clk = of_clk_get(dev, clks[i].id); The of_clk_get() takes clock index rather than name/id as the second parameter. Shawn > ... > > }