From: Dong Aisheng <dongas86@gmail.com> To: Dong Aisheng <aisheng.dong@nxp.com> Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, broonie@kernel.org, yibin.gong@nxp.com, rjw@rjwysocki.net, viresh.kumar@linaro.org, mturquette@baylibre.com, sboyd@codeaurora.org, shawnguo@kernel.org, fabio.estevam@nxp.com, anson.huang@nxp.com, ping.bai@nxp.com, leonard.crestez@nxp.com, octavian.purdila@nxp.com Subject: Re: [RFC PATCH 2/3] clk: add managed version of clk_bulk_get Date: Thu, 13 Apr 2017 22:37:27 +0800 [thread overview] Message-ID: <20170413143727.GE24254@b29396-OptiPlex-7040> (raw) In-Reply-To: <1491969809-20154-3-git-send-email-aisheng.dong@nxp.com> On Wed, Apr 12, 2017 at 12:03:28PM +0800, Dong Aisheng wrote: > This patch introduces the managed version of clk_bulk_get. > > Cc: Michael Turquette <mturquette@baylibre.com> > Cc: Stephen Boyd <sboyd@codeaurora.org> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> > Cc: Viresh Kumar <viresh.kumar@linaro.org> > Cc: Mark Brown <broonie@kernel.org> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Fabio Estevam <fabio.estevam@nxp.com> > Cc: Sascha Hauer <kernel@pengutronix.de> > Cc: Anson Huang <anson.huang@nxp.com> > Cc: Robin Gong <yibin.gong@nxp.com> > Cc: Bai Ping <ping.bai@nxp.com> > Cc: Leonard Crestez <leonard.crestez@nxp.com> > Cc: Octavian Purdila <octavian.purdila@nxp.com> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> > --- > drivers/clk/clk-devres.c | 36 ++++++++++++++++++++++++++++++++++++ > include/linux/clk.h | 22 +++++++++++++++++++++- > 2 files changed, 57 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c > index 3a218c3..c7fb31d 100644 > --- a/drivers/clk/clk-devres.c > +++ b/drivers/clk/clk-devres.c > @@ -34,6 +34,42 @@ struct clk *devm_clk_get(struct device *dev, const char *id) > } > EXPORT_SYMBOL(devm_clk_get); > > +struct clk_bulk_devres { > + struct clk_bulk_data *clks; > + int num_clks; > +}; > + > +static void devm_clk_bulk_release(struct device *dev, void *res) > +{ > + struct clk_bulk_devres *devres = res; > + > + clk_bulk_put(devres->num_clks, devres->clks); > +} > + > +int devm_clk_bulk_get(struct device *dev, int num_clks, > + struct clk_bulk_data *clks) > +{ > + struct clk_bulk_devres *devres; > + int ret; > + > + devres = devres_alloc(devm_clk_bulk_release, > + sizeof(*devres), GFP_KERNEL); > + if (!devres) > + return -ENOMEM; > + > + ret = clk_bulk_get(dev, num_clks, clks); Another catch by 0day robot. drivers/built-in.o: In function `devm_clk_bulk_get': >> (.text+0x1930e): undefined reference to `clk_bulk_get' drivers/built-in.o: In function `devm_clk_bulk_release': >> clk-devres.c:(.text+0x19370): undefined reference to `clk_bulk_put' clk_bulk_get is defined in clkdev.c which depends on CONFIG_CLKDEV_LOOKUP. However, some platforms like m68k may not select CLKDEV_LOOKUP but select HAVE_CLK. Thus compiling devm_clk_bulk_get may cause a undefined reference to 'clk_bulk_get'. Since clk_bulk_get is built upon the platform specific clk_get api, clk_bulk_get can also be used by that platform accordingly. Then we probably could move clk_bulk_get into clk-devres.c as well which is controlled by common CONFIG_HAVE_CLK to benifit all platforms. Regards Dong Aisheng
WARNING: multiple messages have this Message-ID (diff)
From: dongas86@gmail.com (Dong Aisheng) To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 2/3] clk: add managed version of clk_bulk_get Date: Thu, 13 Apr 2017 22:37:27 +0800 [thread overview] Message-ID: <20170413143727.GE24254@b29396-OptiPlex-7040> (raw) In-Reply-To: <1491969809-20154-3-git-send-email-aisheng.dong@nxp.com> On Wed, Apr 12, 2017 at 12:03:28PM +0800, Dong Aisheng wrote: > This patch introduces the managed version of clk_bulk_get. > > Cc: Michael Turquette <mturquette@baylibre.com> > Cc: Stephen Boyd <sboyd@codeaurora.org> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> > Cc: Viresh Kumar <viresh.kumar@linaro.org> > Cc: Mark Brown <broonie@kernel.org> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Fabio Estevam <fabio.estevam@nxp.com> > Cc: Sascha Hauer <kernel@pengutronix.de> > Cc: Anson Huang <anson.huang@nxp.com> > Cc: Robin Gong <yibin.gong@nxp.com> > Cc: Bai Ping <ping.bai@nxp.com> > Cc: Leonard Crestez <leonard.crestez@nxp.com> > Cc: Octavian Purdila <octavian.purdila@nxp.com> > Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> > --- > drivers/clk/clk-devres.c | 36 ++++++++++++++++++++++++++++++++++++ > include/linux/clk.h | 22 +++++++++++++++++++++- > 2 files changed, 57 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c > index 3a218c3..c7fb31d 100644 > --- a/drivers/clk/clk-devres.c > +++ b/drivers/clk/clk-devres.c > @@ -34,6 +34,42 @@ struct clk *devm_clk_get(struct device *dev, const char *id) > } > EXPORT_SYMBOL(devm_clk_get); > > +struct clk_bulk_devres { > + struct clk_bulk_data *clks; > + int num_clks; > +}; > + > +static void devm_clk_bulk_release(struct device *dev, void *res) > +{ > + struct clk_bulk_devres *devres = res; > + > + clk_bulk_put(devres->num_clks, devres->clks); > +} > + > +int devm_clk_bulk_get(struct device *dev, int num_clks, > + struct clk_bulk_data *clks) > +{ > + struct clk_bulk_devres *devres; > + int ret; > + > + devres = devres_alloc(devm_clk_bulk_release, > + sizeof(*devres), GFP_KERNEL); > + if (!devres) > + return -ENOMEM; > + > + ret = clk_bulk_get(dev, num_clks, clks); Another catch by 0day robot. drivers/built-in.o: In function `devm_clk_bulk_get': >> (.text+0x1930e): undefined reference to `clk_bulk_get' drivers/built-in.o: In function `devm_clk_bulk_release': >> clk-devres.c:(.text+0x19370): undefined reference to `clk_bulk_put' clk_bulk_get is defined in clkdev.c which depends on CONFIG_CLKDEV_LOOKUP. However, some platforms like m68k may not select CLKDEV_LOOKUP but select HAVE_CLK. Thus compiling devm_clk_bulk_get may cause a undefined reference to 'clk_bulk_get'. Since clk_bulk_get is built upon the platform specific clk_get api, clk_bulk_get can also be used by that platform accordingly. Then we probably could move clk_bulk_get into clk-devres.c as well which is controlled by common CONFIG_HAVE_CLK to benifit all platforms. Regards Dong Aisheng
next prev parent reply other threads:[~2017-04-13 14:37 UTC|newest] Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-04-12 4:03 [RFC PATCH 0/3] clk: introduce clk_bulk_get accessories Dong Aisheng 2017-04-12 4:03 ` Dong Aisheng 2017-04-11 17:01 ` Florian Fainelli 2017-04-11 17:01 ` Florian Fainelli 2017-04-13 13:58 ` Dong Aisheng 2017-04-13 13:58 ` Dong Aisheng 2017-04-12 4:03 ` [RFC PATCH 1/3] clk: add " Dong Aisheng 2017-04-12 4:03 ` Dong Aisheng 2017-04-11 17:19 ` Leonard Crestez 2017-04-11 17:19 ` Leonard Crestez 2017-04-13 14:02 ` Dong Aisheng 2017-04-13 14:02 ` Dong Aisheng 2017-04-13 19:57 ` Geert Uytterhoeven 2017-04-13 19:57 ` Geert Uytterhoeven 2017-04-13 19:57 ` Geert Uytterhoeven 2017-04-13 14:25 ` Dong Aisheng 2017-04-13 14:25 ` Dong Aisheng 2017-04-13 19:56 ` Geert Uytterhoeven 2017-04-13 19:56 ` Geert Uytterhoeven 2017-04-13 19:56 ` Geert Uytterhoeven 2017-04-14 16:14 ` Dong Aisheng 2017-04-14 16:14 ` Dong Aisheng 2017-04-14 16:14 ` Dong Aisheng 2017-04-22 3:16 ` Stephen Boyd 2017-04-22 3:16 ` Stephen Boyd 2017-05-08 11:34 ` Dong Aisheng 2017-05-08 11:34 ` Dong Aisheng 2017-04-12 4:03 ` [RFC PATCH 2/3] clk: add managed version of clk_bulk_get Dong Aisheng 2017-04-12 4:03 ` Dong Aisheng 2017-04-13 14:37 ` Dong Aisheng [this message] 2017-04-13 14:37 ` Dong Aisheng 2017-04-22 2:58 ` Stephen Boyd 2017-04-22 2:58 ` Stephen Boyd 2017-05-08 11:41 ` Dong Aisheng 2017-05-08 11:41 ` Dong Aisheng 2017-04-22 2:55 ` Stephen Boyd 2017-04-22 2:55 ` Stephen Boyd 2017-05-08 11:37 ` Dong Aisheng 2017-05-08 11:37 ` Dong Aisheng 2017-04-12 4:03 ` [RFC PATCH 3/3] cpufreq: imx6q: refine clk operations Dong Aisheng 2017-04-12 4:03 ` Dong Aisheng 2017-04-11 17:48 ` Leonard Crestez 2017-04-11 17:48 ` Leonard Crestez 2017-04-13 14:21 ` Dong Aisheng 2017-04-13 14:21 ` Dong Aisheng 2017-04-22 3:04 ` [RFC PATCH 0/3] clk: introduce clk_bulk_get accessories Stephen Boyd 2017-04-22 3:04 ` Stephen Boyd 2017-05-08 11:07 ` Dong Aisheng 2017-05-08 11:07 ` Dong Aisheng
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170413143727.GE24254@b29396-OptiPlex-7040 \ --to=dongas86@gmail.com \ --cc=aisheng.dong@nxp.com \ --cc=anson.huang@nxp.com \ --cc=broonie@kernel.org \ --cc=fabio.estevam@nxp.com \ --cc=kernel@pengutronix.de \ --cc=leonard.crestez@nxp.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mturquette@baylibre.com \ --cc=octavian.purdila@nxp.com \ --cc=ping.bai@nxp.com \ --cc=rjw@rjwysocki.net \ --cc=sboyd@codeaurora.org \ --cc=shawnguo@kernel.org \ --cc=viresh.kumar@linaro.org \ --cc=yibin.gong@nxp.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.