* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-09 1:50 ` Shawn Guo
0 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-09 1:50 UTC (permalink / raw)
To: Stephen Boyd, Michael Turquette
Cc: Dong Aisheng, linux-clk, linux-arm-kernel, Shawn Guo
From: Shawn Guo <shawn.guo@linaro.org>
Most of clk API users have their clocks defined in device tree, and
client drivers will have to parse clk ids from DT 'clock-names'
property before using clk_bulk_get(). This is a burden for client
driver code. And 'clock-names' being an optional DT property makes
it even worse. The client driver will have no way to provide clock
id.
The patch makes a little improvement on clk_bulk_get() to call
of_clk_get() with index for DT users, if clock id is not available,
so that client drivers working with DT can use clk_bulk_get() to
retrieve clocks more easily.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/clk/clk-bulk.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
index c834f5abfc49..65cee595a67e 100644
--- a/drivers/clk/clk-bulk.c
+++ b/drivers/clk/clk-bulk.c
@@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
clks[i].clk = NULL;
for (i = 0; i < num_clks; i++) {
- clks[i].clk = clk_get(dev, clks[i].id);
+ if (clks[i].id)
+ clks[i].clk = clk_get(dev, clks[i].id);
+ else if (dev->of_node)
+ clks[i].clk = of_clk_get(dev->of_node, i);
if (IS_ERR(clks[i].clk)) {
ret = PTR_ERR(clks[i].clk);
dev_err(dev, "Failed to get clk '%s': %d\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-09 1:50 ` Shawn Guo
0 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-09 1:50 UTC (permalink / raw)
To: linux-arm-kernel
From: Shawn Guo <shawn.guo@linaro.org>
Most of clk API users have their clocks defined in device tree, and
client drivers will have to parse clk ids from DT 'clock-names'
property before using clk_bulk_get(). This is a burden for client
driver code. And 'clock-names' being an optional DT property makes
it even worse. The client driver will have no way to provide clock
id.
The patch makes a little improvement on clk_bulk_get() to call
of_clk_get() with index for DT users, if clock id is not available,
so that client drivers working with DT can use clk_bulk_get() to
retrieve clocks more easily.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/clk/clk-bulk.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
index c834f5abfc49..65cee595a67e 100644
--- a/drivers/clk/clk-bulk.c
+++ b/drivers/clk/clk-bulk.c
@@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
clks[i].clk = NULL;
for (i = 0; i < num_clks; i++) {
- clks[i].clk = clk_get(dev, clks[i].id);
+ if (clks[i].id)
+ clks[i].clk = clk_get(dev, clks[i].id);
+ else if (dev->of_node)
+ clks[i].clk = of_clk_get(dev->of_node, i);
if (IS_ERR(clks[i].clk)) {
ret = PTR_ERR(clks[i].clk);
dev_err(dev, "Failed to get clk '%s': %d\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-09 1:50 ` Shawn Guo
@ 2017-08-09 17:33 ` Stephen Boyd
-1 siblings, 0 replies; 20+ messages in thread
From: Stephen Boyd @ 2017-08-09 17:33 UTC (permalink / raw)
To: Shawn Guo
Cc: Michael Turquette, Dong Aisheng, linux-clk, linux-arm-kernel, Shawn Guo
On 08/09, Shawn Guo wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> Most of clk API users have their clocks defined in device tree, and
> client drivers will have to parse clk ids from DT 'clock-names'
> property before using clk_bulk_get(). This is a burden for client
> driver code. And 'clock-names' being an optional DT property makes
> it even worse. The client driver will have no way to provide clock
> id.
>
> The patch makes a little improvement on clk_bulk_get() to call
> of_clk_get() with index for DT users, if clock id is not available,
> so that client drivers working with DT can use clk_bulk_get() to
> retrieve clocks more easily.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/clk/clk-bulk.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
> index c834f5abfc49..65cee595a67e 100644
> --- a/drivers/clk/clk-bulk.c
> +++ b/drivers/clk/clk-bulk.c
> @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
> clks[i].clk = NULL;
>
> for (i = 0; i < num_clks; i++) {
> - clks[i].clk = clk_get(dev, clks[i].id);
> + if (clks[i].id)
> + clks[i].clk = clk_get(dev, clks[i].id);
> + else if (dev->of_node)
> + clks[i].clk = of_clk_get(dev->of_node, i);
This seems a little too magical. The omission of an id in an
array of clks would mean that only that one clk is acquired
through of_clk_get(). We could have a mixture of ids and no ids
for some device, and then do very odd things.
How about we add a flag to clk_bulk_data that indicates we want
it to use of_clk_get() instead of clk_get() for all of the clks?
Then the id is ignored for the entire function.
Also, this patch needs to document the new behavior somewhere in
the kernel-doc for this function.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-09 17:33 ` Stephen Boyd
0 siblings, 0 replies; 20+ messages in thread
From: Stephen Boyd @ 2017-08-09 17:33 UTC (permalink / raw)
To: linux-arm-kernel
On 08/09, Shawn Guo wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> Most of clk API users have their clocks defined in device tree, and
> client drivers will have to parse clk ids from DT 'clock-names'
> property before using clk_bulk_get(). This is a burden for client
> driver code. And 'clock-names' being an optional DT property makes
> it even worse. The client driver will have no way to provide clock
> id.
>
> The patch makes a little improvement on clk_bulk_get() to call
> of_clk_get() with index for DT users, if clock id is not available,
> so that client drivers working with DT can use clk_bulk_get() to
> retrieve clocks more easily.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
> drivers/clk/clk-bulk.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
> index c834f5abfc49..65cee595a67e 100644
> --- a/drivers/clk/clk-bulk.c
> +++ b/drivers/clk/clk-bulk.c
> @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
> clks[i].clk = NULL;
>
> for (i = 0; i < num_clks; i++) {
> - clks[i].clk = clk_get(dev, clks[i].id);
> + if (clks[i].id)
> + clks[i].clk = clk_get(dev, clks[i].id);
> + else if (dev->of_node)
> + clks[i].clk = of_clk_get(dev->of_node, i);
This seems a little too magical. The omission of an id in an
array of clks would mean that only that one clk is acquired
through of_clk_get(). We could have a mixture of ids and no ids
for some device, and then do very odd things.
How about we add a flag to clk_bulk_data that indicates we want
it to use of_clk_get() instead of clk_get() for all of the clks?
Then the id is ignored for the entire function.
Also, this patch needs to document the new behavior somewhere in
the kernel-doc for this function.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-09 17:33 ` Stephen Boyd
@ 2017-08-10 1:31 ` Shawn Guo
-1 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-10 1:31 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, Dong Aisheng, linux-clk, linux-arm-kernel, Shawn Guo
Hi Stephen,
Thanks for the review comments.
On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> On 08/09, Shawn Guo wrote:
> > From: Shawn Guo <shawn.guo@linaro.org>
> >
> > Most of clk API users have their clocks defined in device tree, and
> > client drivers will have to parse clk ids from DT 'clock-names'
> > property before using clk_bulk_get(). This is a burden for client
> > driver code. And 'clock-names' being an optional DT property makes
> > it even worse. The client driver will have no way to provide clock
> > id.
> >
> > The patch makes a little improvement on clk_bulk_get() to call
> > of_clk_get() with index for DT users, if clock id is not available,
> > so that client drivers working with DT can use clk_bulk_get() to
> > retrieve clocks more easily.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > ---
> > drivers/clk/clk-bulk.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
> > index c834f5abfc49..65cee595a67e 100644
> > --- a/drivers/clk/clk-bulk.c
> > +++ b/drivers/clk/clk-bulk.c
> > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
> > clks[i].clk = NULL;
> >
> > for (i = 0; i < num_clks; i++) {
> > - clks[i].clk = clk_get(dev, clks[i].id);
> > + if (clks[i].id)
> > + clks[i].clk = clk_get(dev, clks[i].id);
> > + else if (dev->of_node)
> > + clks[i].clk = of_clk_get(dev->of_node, i);
>
> This seems a little too magical. The omission of an id in an
> array of clks would mean that only that one clk is acquired
> through of_clk_get(). We could have a mixture of ids and no ids
> for some device, and then do very odd things.
Yes, I agree.
> How about we add a flag to clk_bulk_data that indicates we want
> it to use of_clk_get() instead of clk_get() for all of the clks?
> Then the id is ignored for the entire function.
Good suggestion.
> Also, this patch needs to document the new behavior somewhere in
> the kernel-doc for this function.
Okay, I will take care of it with the new version.
Shawn
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-10 1:31 ` Shawn Guo
0 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-10 1:31 UTC (permalink / raw)
To: linux-arm-kernel
Hi Stephen,
Thanks for the review comments.
On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> On 08/09, Shawn Guo wrote:
> > From: Shawn Guo <shawn.guo@linaro.org>
> >
> > Most of clk API users have their clocks defined in device tree, and
> > client drivers will have to parse clk ids from DT 'clock-names'
> > property before using clk_bulk_get(). This is a burden for client
> > driver code. And 'clock-names' being an optional DT property makes
> > it even worse. The client driver will have no way to provide clock
> > id.
> >
> > The patch makes a little improvement on clk_bulk_get() to call
> > of_clk_get() with index for DT users, if clock id is not available,
> > so that client drivers working with DT can use clk_bulk_get() to
> > retrieve clocks more easily.
> >
> > Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> > ---
> > drivers/clk/clk-bulk.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
> > index c834f5abfc49..65cee595a67e 100644
> > --- a/drivers/clk/clk-bulk.c
> > +++ b/drivers/clk/clk-bulk.c
> > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
> > clks[i].clk = NULL;
> >
> > for (i = 0; i < num_clks; i++) {
> > - clks[i].clk = clk_get(dev, clks[i].id);
> > + if (clks[i].id)
> > + clks[i].clk = clk_get(dev, clks[i].id);
> > + else if (dev->of_node)
> > + clks[i].clk = of_clk_get(dev->of_node, i);
>
> This seems a little too magical. The omission of an id in an
> array of clks would mean that only that one clk is acquired
> through of_clk_get(). We could have a mixture of ids and no ids
> for some device, and then do very odd things.
Yes, I agree.
> How about we add a flag to clk_bulk_data that indicates we want
> it to use of_clk_get() instead of clk_get() for all of the clks?
> Then the id is ignored for the entire function.
Good suggestion.
> Also, this patch needs to document the new behavior somewhere in
> the kernel-doc for this function.
Okay, I will take care of it with the new version.
Shawn
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-09 17:33 ` Stephen Boyd
@ 2017-08-13 14:18 ` Shawn Guo
-1 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-13 14:18 UTC (permalink / raw)
To: Stephen Boyd
Cc: Michael Turquette, Dong Aisheng, linux-clk, linux-arm-kernel, Shawn Guo
Hi Stephen,
On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
> > index c834f5abfc49..65cee595a67e 100644
> > --- a/drivers/clk/clk-bulk.c
> > +++ b/drivers/clk/clk-bulk.c
> > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
> > clks[i].clk = NULL;
> >
> > for (i = 0; i < num_clks; i++) {
> > - clks[i].clk = clk_get(dev, clks[i].id);
> > + if (clks[i].id)
> > + clks[i].clk = clk_get(dev, clks[i].id);
> > + else if (dev->of_node)
> > + clks[i].clk = of_clk_get(dev->of_node, i);
>
> This seems a little too magical. The omission of an id in an
> array of clks would mean that only that one clk is acquired
> through of_clk_get(). We could have a mixture of ids and no ids
> for some device, and then do very odd things.
>
> How about we add a flag to clk_bulk_data that indicates we want
> it to use of_clk_get() instead of clk_get() for all of the clks?
> Then the id is ignored for the entire function.
I have sent v2 to add a flag to clk_bulk_data to address your comments.
But I just found it might not be what you want exactly, because the
current bulk clk APIs defines clk_bulk_data in a different way from what
you are asking here.
It seems that you think clk_bulk_data represents all the clocks that
bulk APIs manage, but actually it only represents one of the multiple
clocks. Callers need to prepare an array of clk_bulk_data to represent
multiple clocks. That said, the flag we add to clk_bulk_data only
affects one clock instead of all clocks.
I feel this is something we can improve. clk_bulk_data can be used to
represent all clocks, something like below. In this case, bulk clk APIs
do not need to take num_clks as a separate parameter, and callers do not
need to maintain multiple clk_bulk_data instances. Since we do not have
any in tree users of bulk clk APIs yet, we can make this semantic change
quickly. Thoughts?
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 31fee2e8d4a2..ddc4812758f6 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -80,8 +80,10 @@ struct clk_notifier_data {
/**
* struct clk_bulk_data - Data used for bulk clk operations.
*
- * @id: clock consumer ID
- * @clk: struct clk * to store the associated clock
+ * @ids: array of clock consumer IDs which should be provided by caller.
+ * @clks: array of struct clk * to store the associated clocks, which will be
+ * allocated by clk_bulk_get() and freed by clk_bulk_put().
+ * @num_clks: number of clocks that caller wants bulk API to manage.
* @flags: bulk clk operation flags
*
* The CLK APIs provide a series of clk_bulk_() API calls as
@@ -93,8 +95,9 @@ struct clk_notifier_data {
* clk_bulk_get() API will call of_clk_get() to find clock by index.
*/
struct clk_bulk_data {
- const char *id;
- struct clk *clk;
+ const char **ids;
+ struct clk **clks;
+ unsigned int num_clks;
unsigned long flags;
};
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-13 14:18 ` Shawn Guo
0 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-13 14:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Stephen,
On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
> > index c834f5abfc49..65cee595a67e 100644
> > --- a/drivers/clk/clk-bulk.c
> > +++ b/drivers/clk/clk-bulk.c
> > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
> > clks[i].clk = NULL;
> >
> > for (i = 0; i < num_clks; i++) {
> > - clks[i].clk = clk_get(dev, clks[i].id);
> > + if (clks[i].id)
> > + clks[i].clk = clk_get(dev, clks[i].id);
> > + else if (dev->of_node)
> > + clks[i].clk = of_clk_get(dev->of_node, i);
>
> This seems a little too magical. The omission of an id in an
> array of clks would mean that only that one clk is acquired
> through of_clk_get(). We could have a mixture of ids and no ids
> for some device, and then do very odd things.
>
> How about we add a flag to clk_bulk_data that indicates we want
> it to use of_clk_get() instead of clk_get() for all of the clks?
> Then the id is ignored for the entire function.
I have sent v2 to add a flag to clk_bulk_data to address your comments.
But I just found it might not be what you want exactly, because the
current bulk clk APIs defines clk_bulk_data in a different way from what
you are asking here.
It seems that you think clk_bulk_data represents all the clocks that
bulk APIs manage, but actually it only represents one of the multiple
clocks. Callers need to prepare an array of clk_bulk_data to represent
multiple clocks. That said, the flag we add to clk_bulk_data only
affects one clock instead of all clocks.
I feel this is something we can improve. clk_bulk_data can be used to
represent all clocks, something like below. In this case, bulk clk APIs
do not need to take num_clks as a separate parameter, and callers do not
need to maintain multiple clk_bulk_data instances. Since we do not have
any in tree users of bulk clk APIs yet, we can make this semantic change
quickly. Thoughts?
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 31fee2e8d4a2..ddc4812758f6 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -80,8 +80,10 @@ struct clk_notifier_data {
/**
* struct clk_bulk_data - Data used for bulk clk operations.
*
- * @id: clock consumer ID
- * @clk: struct clk * to store the associated clock
+ * @ids: array of clock consumer IDs which should be provided by caller.
+ * @clks: array of struct clk * to store the associated clocks, which will be
+ * allocated by clk_bulk_get() and freed by clk_bulk_put().
+ * @num_clks: number of clocks that caller wants bulk API to manage.
* @flags: bulk clk operation flags
*
* The CLK APIs provide a series of clk_bulk_() API calls as
@@ -93,8 +95,9 @@ struct clk_notifier_data {
* clk_bulk_get() API will call of_clk_get() to find clock by index.
*/
struct clk_bulk_data {
- const char *id;
- struct clk *clk;
+ const char **ids;
+ struct clk **clks;
+ unsigned int num_clks;
unsigned long flags;
};
^ permalink raw reply related [flat|nested] 20+ messages in thread
* RE: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-13 14:18 ` Shawn Guo
@ 2017-08-30 15:31 ` A.s. Dong
-1 siblings, 0 replies; 20+ messages in thread
From: A.s. Dong @ 2017-08-30 15:31 UTC (permalink / raw)
To: Shawn Guo, Stephen Boyd
Cc: Michael Turquette, linux-clk, linux-arm-kernel, Shawn Guo
> -----Original Message-----
> From: Shawn Guo [mailto:shawnguo@kernel.org]
> Sent: Sunday, August 13, 2017 10:19 PM
> To: Stephen Boyd
> Cc: Michael Turquette; A.s. Dong; 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
>=20
> Hi Stephen,
>=20
> On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> > > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index
> > > c834f5abfc49..65cee595a67e 100644
> > > --- a/drivers/clk/clk-bulk.c
> > > +++ b/drivers/clk/clk-bulk.c
> > > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev,
> int num_clks,
> > > clks[i].clk =3D NULL;
> > >
> > > for (i =3D 0; i < num_clks; i++) {
> > > - clks[i].clk =3D clk_get(dev, clks[i].id);
> > > + if (clks[i].id)
> > > + clks[i].clk =3D clk_get(dev, clks[i].id);
> > > + else if (dev->of_node)
> > > + clks[i].clk =3D of_clk_get(dev->of_node, i);
> >
> > This seems a little too magical. The omission of an id in an array of
> > clks would mean that only that one clk is acquired through
> > of_clk_get(). We could have a mixture of ids and no ids for some
> > device, and then do very odd things.
> >
> > How about we add a flag to clk_bulk_data that indicates we want it to
> > use of_clk_get() instead of clk_get() for all of the clks?
> > Then the id is ignored for the entire function.
>=20
> I have sent v2 to add a flag to clk_bulk_data to address your comments.
> But I just found it might not be what you want exactly, because the
> current bulk clk APIs defines clk_bulk_data in a different way from what
> you are asking here.
>=20
> It seems that you think clk_bulk_data represents all the clocks that bulk
> APIs manage, but actually it only represents one of the multiple clocks.
> Callers need to prepare an array of clk_bulk_data to represent multiple
> clocks. That said, the flag we add to clk_bulk_data only affects one
> clock instead of all clocks.
>=20
> I feel this is something we can improve. clk_bulk_data can be used to
> represent all clocks, something like below. In this case, bulk clk APIs
> do not need to take num_clks as a separate parameter, and callers do not
> need to maintain multiple clk_bulk_data instances. Since we do not have
> any in tree users of bulk clk APIs yet, we can make this semantic change
> quickly. Thoughts?
>=20
Flags may be better used for extending per clk feature support in the futur=
e.
IMHO how about implement a of_clk_bulk_get() to handle this issue as we alr=
eady
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 =3D 0; i < num_clks; i++) {
clks[i].clk =3D of_clk_get(dev, clks[i].id);
...
}
Then it's less intrusive.
Regards
Dong Aisheng
> diff --git a/include/linux/clk.h b/include/linux/clk.h index
> 31fee2e8d4a2..ddc4812758f6 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -80,8 +80,10 @@ struct clk_notifier_data {
> /**
> * struct clk_bulk_data - Data used for bulk clk operations.
> *
> - * @id: clock consumer ID
> - * @clk: struct clk * to store the associated clock
> + * @ids: array of clock consumer IDs which should be provided by caller.
> + * @clks: array of struct clk * to store the associated clocks, which
> will be
> + * allocated by clk_bulk_get() and freed by clk_bulk_put().
> + * @num_clks: number of clocks that caller wants bulk API to manage.
> * @flags: bulk clk operation flags
> *
> * The CLK APIs provide a series of clk_bulk_() API calls as @@ -93,8
> +95,9 @@ struct clk_notifier_data {
> * clk_bulk_get() API will call of_clk_get() to find clock by index.
> */
> struct clk_bulk_data {
> - const char *id;
> - struct clk *clk;
> + const char **ids;
> + struct clk **clks;
> + unsigned int num_clks;
> unsigned long flags;
> };
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-30 15:31 ` A.s. Dong
0 siblings, 0 replies; 20+ messages in thread
From: A.s. Dong @ 2017-08-30 15:31 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Shawn Guo [mailto:shawnguo at kernel.org]
> Sent: Sunday, August 13, 2017 10:19 PM
> To: Stephen Boyd
> Cc: Michael Turquette; A.s. Dong; linux-clk at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; Shawn Guo
> Subject: Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
>
> Hi Stephen,
>
> On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> > > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index
> > > c834f5abfc49..65cee595a67e 100644
> > > --- a/drivers/clk/clk-bulk.c
> > > +++ b/drivers/clk/clk-bulk.c
> > > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev,
> int num_clks,
> > > clks[i].clk = NULL;
> > >
> > > for (i = 0; i < num_clks; i++) {
> > > - clks[i].clk = clk_get(dev, clks[i].id);
> > > + if (clks[i].id)
> > > + clks[i].clk = clk_get(dev, clks[i].id);
> > > + else if (dev->of_node)
> > > + clks[i].clk = of_clk_get(dev->of_node, i);
> >
> > This seems a little too magical. The omission of an id in an array of
> > clks would mean that only that one clk is acquired through
> > of_clk_get(). We could have a mixture of ids and no ids for some
> > device, and then do very odd things.
> >
> > How about we add a flag to clk_bulk_data that indicates we want it to
> > use of_clk_get() instead of clk_get() for all of the clks?
> > Then the id is ignored for the entire function.
>
> I have sent v2 to add a flag to clk_bulk_data to address your comments.
> But I just found it might not be what you want exactly, because the
> current bulk clk APIs defines clk_bulk_data in a different way from what
> you are asking here.
>
> It seems that you think clk_bulk_data represents all the clocks that bulk
> APIs manage, but actually it only represents one of the multiple clocks.
> Callers need to prepare an array of clk_bulk_data to represent multiple
> clocks. That said, the flag we add to clk_bulk_data only affects one
> clock instead of all clocks.
>
> I feel this is something we can improve. clk_bulk_data can be used to
> represent all clocks, something like below. In this case, bulk clk APIs
> do not need to take num_clks as a separate parameter, and callers do not
> need to maintain multiple clk_bulk_data instances. Since we do not have
> any in tree users of bulk clk APIs yet, we can make this semantic change
> quickly. Thoughts?
>
Flags may be better used for extending per clk feature support in the future.
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);
...
}
Then it's less intrusive.
Regards
Dong Aisheng
> diff --git a/include/linux/clk.h b/include/linux/clk.h index
> 31fee2e8d4a2..ddc4812758f6 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -80,8 +80,10 @@ struct clk_notifier_data {
> /**
> * struct clk_bulk_data - Data used for bulk clk operations.
> *
> - * @id: clock consumer ID
> - * @clk: struct clk * to store the associated clock
> + * @ids: array of clock consumer IDs which should be provided by caller.
> + * @clks: array of struct clk * to store the associated clocks, which
> will be
> + * allocated by clk_bulk_get() and freed by clk_bulk_put().
> + * @num_clks: number of clocks that caller wants bulk API to manage.
> * @flags: bulk clk operation flags
> *
> * The CLK APIs provide a series of clk_bulk_() API calls as @@ -93,8
> +95,9 @@ struct clk_notifier_data {
> * clk_bulk_get() API will call of_clk_get() to find clock by index.
> */
> struct clk_bulk_data {
> - const char *id;
> - struct clk *clk;
> + const char **ids;
> + struct clk **clks;
> + unsigned int num_clks;
> unsigned long flags;
> };
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-30 15:31 ` A.s. Dong
@ 2017-08-31 5:26 ` Stephen Boyd
-1 siblings, 0 replies; 20+ messages in thread
From: Stephen Boyd @ 2017-08-31 5:26 UTC (permalink / raw)
To: A.s. Dong
Cc: Shawn Guo, Michael Turquette, linux-clk, linux-arm-kernel, Shawn Guo
On 08/30, A.s. Dong wrote:
> > -----Original Message-----
> > From: Shawn Guo [mailto:shawnguo@kernel.org]
> > Sent: Sunday, August 13, 2017 10:19 PM
> > To: Stephen Boyd
> > Cc: Michael Turquette; A.s. Dong; 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
> >
> > Hi Stephen,
> >
> > On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> > > > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index
> > > > c834f5abfc49..65cee595a67e 100644
> > > > --- a/drivers/clk/clk-bulk.c
> > > > +++ b/drivers/clk/clk-bulk.c
> > > > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev,
> > int num_clks,
> > > > clks[i].clk = NULL;
> > > >
> > > > for (i = 0; i < num_clks; i++) {
> > > > - clks[i].clk = clk_get(dev, clks[i].id);
> > > > + if (clks[i].id)
> > > > + clks[i].clk = clk_get(dev, clks[i].id);
> > > > + else if (dev->of_node)
> > > > + clks[i].clk = of_clk_get(dev->of_node, i);
> > >
> > > This seems a little too magical. The omission of an id in an array of
> > > clks would mean that only that one clk is acquired through
> > > of_clk_get(). We could have a mixture of ids and no ids for some
> > > device, and then do very odd things.
> > >
> > > How about we add a flag to clk_bulk_data that indicates we want it to
> > > use of_clk_get() instead of clk_get() for all of the clks?
> > > Then the id is ignored for the entire function.
> >
> > I have sent v2 to add a flag to clk_bulk_data to address your comments.
> > But I just found it might not be what you want exactly, because the
> > current bulk clk APIs defines clk_bulk_data in a different way from what
> > you are asking here.
> >
> > It seems that you think clk_bulk_data represents all the clocks that bulk
> > APIs manage, but actually it only represents one of the multiple clocks.
> > Callers need to prepare an array of clk_bulk_data to represent multiple
> > clocks. That said, the flag we add to clk_bulk_data only affects one
> > clock instead of all clocks.
> >
> > I feel this is something we can improve. clk_bulk_data can be used to
> > represent all clocks, something like below. In this case, bulk clk APIs
> > do not need to take num_clks as a separate parameter, and callers do not
> > need to maintain multiple clk_bulk_data instances. Since we do not have
> > any in tree users of bulk clk APIs yet, we can make this semantic change
> > quickly. Thoughts?
> >
>
> Flags may be better used for extending per clk feature support in the future.
>
> 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);
> ...
>
> }
>
> Then it's less intrusive.
>
This looks ok too. Go ahead and send this version instead.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-31 5:26 ` Stephen Boyd
0 siblings, 0 replies; 20+ messages in thread
From: Stephen Boyd @ 2017-08-31 5:26 UTC (permalink / raw)
To: linux-arm-kernel
On 08/30, A.s. Dong wrote:
> > -----Original Message-----
> > From: Shawn Guo [mailto:shawnguo at kernel.org]
> > Sent: Sunday, August 13, 2017 10:19 PM
> > To: Stephen Boyd
> > Cc: Michael Turquette; A.s. Dong; linux-clk at vger.kernel.org; linux-arm-
> > kernel at lists.infradead.org; Shawn Guo
> > Subject: Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
> >
> > Hi Stephen,
> >
> > On Wed, Aug 09, 2017 at 10:33:18AM -0700, Stephen Boyd wrote:
> > > > diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c index
> > > > c834f5abfc49..65cee595a67e 100644
> > > > --- a/drivers/clk/clk-bulk.c
> > > > +++ b/drivers/clk/clk-bulk.c
> > > > @@ -39,7 +39,10 @@ int __must_check clk_bulk_get(struct device *dev,
> > int num_clks,
> > > > clks[i].clk = NULL;
> > > >
> > > > for (i = 0; i < num_clks; i++) {
> > > > - clks[i].clk = clk_get(dev, clks[i].id);
> > > > + if (clks[i].id)
> > > > + clks[i].clk = clk_get(dev, clks[i].id);
> > > > + else if (dev->of_node)
> > > > + clks[i].clk = of_clk_get(dev->of_node, i);
> > >
> > > This seems a little too magical. The omission of an id in an array of
> > > clks would mean that only that one clk is acquired through
> > > of_clk_get(). We could have a mixture of ids and no ids for some
> > > device, and then do very odd things.
> > >
> > > How about we add a flag to clk_bulk_data that indicates we want it to
> > > use of_clk_get() instead of clk_get() for all of the clks?
> > > Then the id is ignored for the entire function.
> >
> > I have sent v2 to add a flag to clk_bulk_data to address your comments.
> > But I just found it might not be what you want exactly, because the
> > current bulk clk APIs defines clk_bulk_data in a different way from what
> > you are asking here.
> >
> > It seems that you think clk_bulk_data represents all the clocks that bulk
> > APIs manage, but actually it only represents one of the multiple clocks.
> > Callers need to prepare an array of clk_bulk_data to represent multiple
> > clocks. That said, the flag we add to clk_bulk_data only affects one
> > clock instead of all clocks.
> >
> > I feel this is something we can improve. clk_bulk_data can be used to
> > represent all clocks, something like below. In this case, bulk clk APIs
> > do not need to take num_clks as a separate parameter, and callers do not
> > need to maintain multiple clk_bulk_data instances. Since we do not have
> > any in tree users of bulk clk APIs yet, we can make this semantic change
> > quickly. Thoughts?
> >
>
> Flags may be better used for extending per clk feature support in the future.
>
> 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);
> ...
>
> }
>
> Then it's less intrusive.
>
This looks ok too. Go ahead and send this version instead.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-30 15:31 ` A.s. Dong
@ 2017-08-31 7:01 ` Shawn Guo
-1 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-31 7:01 UTC (permalink / raw)
To: A.s. Dong
Cc: Stephen Boyd, Michael Turquette, linux-clk, linux-arm-kernel, Shawn Guo
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
> ...
>
> }
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-31 7:01 ` Shawn Guo
0 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-08-31 7:01 UTC (permalink / raw)
To: linux-arm-kernel
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
> ...
>
> }
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-31 7:01 ` Shawn Guo
@ 2017-08-31 7:12 ` A.s. Dong
-1 siblings, 0 replies; 20+ messages in thread
From: A.s. Dong @ 2017-08-31 7:12 UTC (permalink / raw)
To: Shawn Guo
Cc: Stephen Boyd, Michael Turquette, linux-clk, linux-arm-kernel, Shawn Guo
> -----Original Message-----
> From: Shawn Guo [mailto:shawnguo@kernel.org]
> Sent: Thursday, August 31, 2017 3:01 PM
> 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
>=20
> 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 =3D 0; i < num_clks; i++) {
> > clks[i].clk =3D of_clk_get(dev, clks[i].id);
>=20
> The of_clk_get() takes clock index rather than name/id as the second
> parameter.
>=20
You're right.
It's for only an idea demonstration, so sent too quick! :-)
Regards
Dong Aisheng
> Shawn
>=20
> > ...
> >
> > }
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-08-31 7:12 ` A.s. Dong
0 siblings, 0 replies; 20+ messages in thread
From: A.s. Dong @ 2017-08-31 7:12 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Shawn Guo [mailto:shawnguo at kernel.org]
> Sent: Thursday, August 31, 2017 3:01 PM
> To: A.s. Dong
> Cc: Stephen Boyd; Michael Turquette; linux-clk at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; Shawn Guo
> Subject: Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
>
> 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.
>
You're right.
It's for only an idea demonstration, so sent too quick! :-)
Regards
Dong Aisheng
> Shawn
>
> > ...
> >
> > }
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-08-31 5:26 ` Stephen Boyd
@ 2017-09-11 4:51 ` A.s. Dong
-1 siblings, 0 replies; 20+ messages in thread
From: A.s. Dong @ 2017-09-11 4:51 UTC (permalink / raw)
To: Shawn Guo
Cc: Michael Turquette, linux-clk, linux-arm-kernel, Shawn Guo, Stephen Boyd
Hi Shawn,
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@codeaurora.org]
> Sent: Thursday, August 31, 2017 1:27 PM
> To: A.s. Dong
> Cc: Shawn Guo; 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
>=20
> On 08/30, A.s. Dong wrote:
[...]
> > Flags may be better used for extending per clk feature support in the
> future.
> >
> > 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 =3D 0; i < num_clks; i++) {
> > clks[i].clk =3D of_clk_get(dev, clks[i].id); ...
> >
> > }
> >
> > Then it's less intrusive.
> >
>=20
> This looks ok too. Go ahead and send this version instead.
>=20
I did not see you send a update version.
If you will not do it, would you mind me to help send it with a Reported-by=
: tag from you?
Regards
Dong Aisheng
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-09-11 4:51 ` A.s. Dong
0 siblings, 0 replies; 20+ messages in thread
From: A.s. Dong @ 2017-09-11 4:51 UTC (permalink / raw)
To: linux-arm-kernel
Hi Shawn,
> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd at codeaurora.org]
> Sent: Thursday, August 31, 2017 1:27 PM
> To: A.s. Dong
> Cc: Shawn Guo; Michael Turquette; linux-clk at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; Shawn Guo
> Subject: Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
>
> On 08/30, A.s. Dong wrote:
[...]
> > Flags may be better used for extending per clk feature support in the
> future.
> >
> > 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); ...
> >
> > }
> >
> > Then it's less intrusive.
> >
>
> This looks ok too. Go ahead and send this version instead.
>
I did not see you send a update version.
If you will not do it, would you mind me to help send it with a Reported-by: tag from you?
Regards
Dong Aisheng
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
2017-09-11 4:51 ` A.s. Dong
@ 2017-09-11 5:57 ` Shawn Guo
-1 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-09-11 5:57 UTC (permalink / raw)
To: A.s. Dong
Cc: Michael Turquette, Shawn Guo, Stephen Boyd, linux-clk, linux-arm-kernel
On Mon, Sep 11, 2017 at 04:51:28AM +0000, A.s. Dong wrote:
> Hi Shawn,
>
> > -----Original Message-----
> > From: Stephen Boyd [mailto:sboyd@codeaurora.org]
> > Sent: Thursday, August 31, 2017 1:27 PM
> > To: A.s. Dong
> > Cc: Shawn Guo; 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
> >
> > On 08/30, A.s. Dong wrote:
>
> [...]
>
> > > Flags may be better used for extending per clk feature support in the
> > future.
> > >
> > > 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); ...
> > >
> > > }
> > >
> > > Then it's less intrusive.
> > >
> >
> > This looks ok too. Go ahead and send this version instead.
> >
>
> I did not see you send a update version.
> If you will not do it, would you mind me to help send it with a Reported-by: tag from you?
Sure, go ahead.
Shawn
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] clk: bulk: call of_clk_get() when id is NULL
@ 2017-09-11 5:57 ` Shawn Guo
0 siblings, 0 replies; 20+ messages in thread
From: Shawn Guo @ 2017-09-11 5:57 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Sep 11, 2017 at 04:51:28AM +0000, A.s. Dong wrote:
> Hi Shawn,
>
> > -----Original Message-----
> > From: Stephen Boyd [mailto:sboyd at codeaurora.org]
> > Sent: Thursday, August 31, 2017 1:27 PM
> > To: A.s. Dong
> > Cc: Shawn Guo; Michael Turquette; linux-clk at vger.kernel.org; linux-arm-
> > kernel at lists.infradead.org; Shawn Guo
> > Subject: Re: [PATCH] clk: bulk: call of_clk_get() when id is NULL
> >
> > On 08/30, A.s. Dong wrote:
>
> [...]
>
> > > Flags may be better used for extending per clk feature support in the
> > future.
> > >
> > > 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); ...
> > >
> > > }
> > >
> > > Then it's less intrusive.
> > >
> >
> > This looks ok too. Go ahead and send this version instead.
> >
>
> I did not see you send a update version.
> If you will not do it, would you mind me to help send it with a Reported-by: tag from you?
Sure, go ahead.
Shawn
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2017-09-11 5:57 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 1:50 [PATCH] clk: bulk: call of_clk_get() when id is NULL Shawn Guo
2017-08-09 1:50 ` Shawn Guo
2017-08-09 17:33 ` Stephen Boyd
2017-08-09 17:33 ` Stephen Boyd
2017-08-10 1:31 ` Shawn Guo
2017-08-10 1:31 ` Shawn Guo
2017-08-13 14:18 ` Shawn Guo
2017-08-13 14:18 ` Shawn Guo
2017-08-30 15:31 ` A.s. Dong
2017-08-30 15:31 ` A.s. Dong
2017-08-31 5:26 ` Stephen Boyd
2017-08-31 5:26 ` Stephen Boyd
2017-09-11 4:51 ` A.s. Dong
2017-09-11 4:51 ` A.s. Dong
2017-09-11 5:57 ` Shawn Guo
2017-09-11 5:57 ` Shawn Guo
2017-08-31 7:01 ` Shawn Guo
2017-08-31 7:01 ` Shawn Guo
2017-08-31 7:12 ` A.s. Dong
2017-08-31 7:12 ` A.s. Dong
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.