lkml.org 
[lkml]   [2018]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V3 0/4] clk: new APIs to handle all available clocks
Date
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@kernel.org]
> Sent: Wednesday, August 29, 2018 11:09 AM
> To: A.s. Dong <aisheng.dong@nxp.com>
> Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> mturquette@baylibre.com; shawnguo@kernel.org; dl-linux-imx
> <linux-imx@nxp.com>; thor.thayer@linux.intel.com; linux-clk@vger.kernel.org
> Subject: RE: [PATCH V3 0/4] clk: new APIs to handle all available clocks
>
> Quoting A.s. Dong (2018-08-16 19:33:52)
> > Hi Stephen,
> >
> > Do you want me to resend this series for review?
> > It seems have been pending for quite a long time.
> >
> > Thor just pinged me for its status as he wants to use it.
> >
>
> I was waiting for someone to try them out or review them. Good that it
> happened!
>
> I've taken a look at the patches and I'm slightly annoyed with the API that
> passes in a double pointer to clk_bulk_data and returns a count of the number
> of clks found. I guess it's ok though. It's really just this
> line:
>
> devres->clks = *clks;
>
> which makes my brain all confused and go think about what's being assigned
> and if it's a struct copy or not.
>
> Maybe this on top would make it easier to take? I'll think about it tonight.
>

Looks like a good idea to me.
Will update and resend.
Thanks for the suggestion.

Regards
Dong Aisheng

> ---8<---
> diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c index
> 6d3ca5ec5de8..12c87457eca1 100644
> --- a/drivers/clk/clk-devres.c
> +++ b/drivers/clk/clk-devres.c
> @@ -81,9 +81,9 @@ int __must_check devm_clk_bulk_get_all(struct device
> *dev,
> if (!devres)
> return -ENOMEM;
>
> - ret = clk_bulk_get_all(dev, clks);
> + ret = clk_bulk_get_all(dev, &devres->clks);
> if (ret > 0) {
> - devres->clks = *clks;
> + *clks = devres->clks;
> devres->num_clks = ret;
> devres_add(dev, devres);
> } else {
\
 
 \ /
  Last update: 2018-08-29 14:27    [W:0.059 / U:1.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site