From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755993AbdDMT4f (ORCPT ); Thu, 13 Apr 2017 15:56:35 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:36396 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755416AbdDMT4d (ORCPT ); Thu, 13 Apr 2017 15:56:33 -0400 MIME-Version: 1.0 In-Reply-To: <1491969809-20154-2-git-send-email-aisheng.dong@nxp.com> References: <1491969809-20154-1-git-send-email-aisheng.dong@nxp.com> <1491969809-20154-2-git-send-email-aisheng.dong@nxp.com> From: Geert Uytterhoeven Date: Thu, 13 Apr 2017 21:56:31 +0200 X-Google-Sender-Auth: 0X0CAaab3exapZbGMJyGkuj9w2o Message-ID: Subject: Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories To: Dong Aisheng Cc: linux-clk , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Sascha Hauer , Mark Brown , yibin.gong@nxp.com, "Rafael J. Wysocki" , Viresh Kumar , Michael Turquette , Stephen Boyd , Shawn Guo , Fabio Estevam , anson.huang@nxp.com, ping.bai@nxp.com, leonard.crestez@nxp.com, octavian.purdila@nxp.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng wrote: > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk) > } > EXPORT_SYMBOL_GPL(clk_unprepare); > > +/** > + * clk_bulk_unprepare - undo preparation of a bulk of clock sources > + * @num_clks: the number of clk_bulk_data > + * @clks: the clk_bulk_data table being ungated > + * > + * clk_bulk_unprepare may sleep, which differentiates it from clk_bulk_disable. > + * Returns 0 on success, -EERROR otherwise. > + */ > +void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks) unsigned int num_clks (everywhere) > +{ > + int i; unsigned int i (everywhere) > + > + for (i = 0; i < num_clks; i++) > + clk_unprepare(clks[i].clk); > +} > +EXPORT_SYMBOL_GPL(clk_bulk_unprepare); This does mean you have to change your "while (--i >= 0)" loops. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 Sender: geert.uytterhoeven@gmail.com In-Reply-To: <1491969809-20154-2-git-send-email-aisheng.dong@nxp.com> References: <1491969809-20154-1-git-send-email-aisheng.dong@nxp.com> <1491969809-20154-2-git-send-email-aisheng.dong@nxp.com> From: Geert Uytterhoeven Date: Thu, 13 Apr 2017 21:56:31 +0200 Message-ID: Subject: Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories To: Dong Aisheng Cc: linux-clk , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Sascha Hauer , Mark Brown , yibin.gong@nxp.com, "Rafael J. Wysocki" , Viresh Kumar , Michael Turquette , Stephen Boyd , Shawn Guo , Fabio Estevam , anson.huang@nxp.com, ping.bai@nxp.com, leonard.crestez@nxp.com, octavian.purdila@nxp.com Content-Type: text/plain; charset=UTF-8 List-ID: On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng wrote: > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk) > } > EXPORT_SYMBOL_GPL(clk_unprepare); > > +/** > + * clk_bulk_unprepare - undo preparation of a bulk of clock sources > + * @num_clks: the number of clk_bulk_data > + * @clks: the clk_bulk_data table being ungated > + * > + * clk_bulk_unprepare may sleep, which differentiates it from clk_bulk_disable. > + * Returns 0 on success, -EERROR otherwise. > + */ > +void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks) unsigned int num_clks (everywhere) > +{ > + int i; unsigned int i (everywhere) > + > + for (i = 0; i < num_clks; i++) > + clk_unprepare(clks[i].clk); > +} > +EXPORT_SYMBOL_GPL(clk_bulk_unprepare); This does mean you have to change your "while (--i >= 0)" loops. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds From mboxrd@z Thu Jan 1 00:00:00 1970 From: geert@linux-m68k.org (Geert Uytterhoeven) Date: Thu, 13 Apr 2017 21:56:31 +0200 Subject: [RFC PATCH 1/3] clk: add clk_bulk_get accessories In-Reply-To: <1491969809-20154-2-git-send-email-aisheng.dong@nxp.com> References: <1491969809-20154-1-git-send-email-aisheng.dong@nxp.com> <1491969809-20154-2-git-send-email-aisheng.dong@nxp.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Apr 12, 2017 at 6:03 AM, Dong Aisheng wrote: > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -520,6 +520,23 @@ void clk_unprepare(struct clk *clk) > } > EXPORT_SYMBOL_GPL(clk_unprepare); > > +/** > + * clk_bulk_unprepare - undo preparation of a bulk of clock sources > + * @num_clks: the number of clk_bulk_data > + * @clks: the clk_bulk_data table being ungated > + * > + * clk_bulk_unprepare may sleep, which differentiates it from clk_bulk_disable. > + * Returns 0 on success, -EERROR otherwise. > + */ > +void clk_bulk_unprepare(int num_clks, struct clk_bulk_data *clks) unsigned int num_clks (everywhere) > +{ > + int i; unsigned int i (everywhere) > + > + for (i = 0; i < num_clks; i++) > + clk_unprepare(clks[i].clk); > +} > +EXPORT_SYMBOL_GPL(clk_bulk_unprepare); This does mean you have to change your "while (--i >= 0)" loops. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds