[PATCH v3 01/19] clk: composite: Add unregister function

2016-04-21 Thread Stephen Boyd
On 04/19, Maxime Ripard wrote:
> 
> I have a bunch of other clock patches that need this, so I guess it
> would be easier if applied it directly with your acked-by, or if you
> could apply it and give a stable branch I can base my future PR on.

Ok. I pushed it to stable branch 'clk-composite-unregister' in
the clk.git repo. That way I can go ahead and delete this API
assuming I get around to converting all the composite users in
the next few days.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


[PATCH v3 01/19] clk: composite: Add unregister function

2016-04-19 Thread Maxime Ripard
Hi,

On Fri, Apr 15, 2016 at 03:28:56PM -0700, Stephen Boyd wrote:
> On 03/23, Maxime Ripard wrote:
> > The composite clock didn't have any unregistration function, which forced
> > us to use clk_unregister directly on it.
> > 
> > While it was already not great from an API point of view, it also meant
> > that we were leaking the clk_composite structure allocated in
> > clk_register_composite.
> > 
> > Add a clk_unregister_composite function to fix this.
> > 
> > Signed-off-by: Maxime Ripard 
> > ---
> 
> I'm currently attempting to change the way clks are registered so
> that we don't return clk pointers from clk_register and have
> users add OF clk providers that return clk_hw pointers instead of
> clk pointers. Just a note, that this whole thing should be
> deleted in the next cycle if I can convert everything!

Ok.

> 
> >  drivers/clk/clk-composite.c  | 15 +++
> >  include/linux/clk-provider.h |  1 +
> >  2 files changed, 16 insertions(+)
> > 
> > diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
> > index 1f903e1f86a2..b0f3b84ebd13 100644
> > --- a/drivers/clk/clk-composite.c
> > +++ b/drivers/clk/clk-composite.c
> > @@ -286,3 +286,18 @@ err:
> > kfree(composite);
> > return clk;
> >  }
> > +
> > +void clk_unregister_composite(struct clk *clk)
> > +{
> > +   struct clk_composite *composite;
> > +   struct clk_hw *hw;
> > +
> > +   hw = __clk_get_hw(clk);
> > +   if (!hw)
> > +   return;
> > +
> > +   composite = to_clk_composite(hw);
> > +
> > +   clk_unregister(clk);
> > +   kfree(composite);
> > +}
> 
> EXPORT_SYMBOL_GPL?

The register function is not registered, so I don't think that's
necessary.

> Do I need to pick this up?

I have a bunch of other clock patches that need this, so I guess it
would be easier if applied it directly with your acked-by, or if you
could apply it and give a stable branch I can base my future PR on.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: 



[PATCH v3 01/19] clk: composite: Add unregister function

2016-04-15 Thread Stephen Boyd
On 03/23, Maxime Ripard wrote:
> The composite clock didn't have any unregistration function, which forced
> us to use clk_unregister directly on it.
> 
> While it was already not great from an API point of view, it also meant
> that we were leaking the clk_composite structure allocated in
> clk_register_composite.
> 
> Add a clk_unregister_composite function to fix this.
> 
> Signed-off-by: Maxime Ripard 
> ---

I'm currently attempting to change the way clks are registered so
that we don't return clk pointers from clk_register and have
users add OF clk providers that return clk_hw pointers instead of
clk pointers. Just a note, that this whole thing should be
deleted in the next cycle if I can convert everything!

>  drivers/clk/clk-composite.c  | 15 +++
>  include/linux/clk-provider.h |  1 +
>  2 files changed, 16 insertions(+)
> 
> diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
> index 1f903e1f86a2..b0f3b84ebd13 100644
> --- a/drivers/clk/clk-composite.c
> +++ b/drivers/clk/clk-composite.c
> @@ -286,3 +286,18 @@ err:
>   kfree(composite);
>   return clk;
>  }
> +
> +void clk_unregister_composite(struct clk *clk)
> +{
> + struct clk_composite *composite;
> + struct clk_hw *hw;
> +
> + hw = __clk_get_hw(clk);
> + if (!hw)
> + return;
> +
> + composite = to_clk_composite(hw);
> +
> + clk_unregister(clk);
> + kfree(composite);
> +}

EXPORT_SYMBOL_GPL?

Do I need to pick this up?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


[PATCH v3 01/19] clk: composite: Add unregister function

2016-04-10 Thread Maxime Ripard
Hi Stephen, Mike,

On Wed, Mar 23, 2016 at 05:38:24PM +0100, Maxime Ripard wrote:
> The composite clock didn't have any unregistration function, which forced
> us to use clk_unregister directly on it.
> 
> While it was already not great from an API point of view, it also meant
> that we were leaking the clk_composite structure allocated in
> clk_register_composite.
> 
> Add a clk_unregister_composite function to fix this.
> 
> Signed-off-by: Maxime Ripard 

Any comment on this one ?

(and the other clock patches)

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: 



[PATCH v3 01/19] clk: composite: Add unregister function

2016-03-23 Thread Maxime Ripard
The composite clock didn't have any unregistration function, which forced
us to use clk_unregister directly on it.

While it was already not great from an API point of view, it also meant
that we were leaking the clk_composite structure allocated in
clk_register_composite.

Add a clk_unregister_composite function to fix this.

Signed-off-by: Maxime Ripard 
---
 drivers/clk/clk-composite.c  | 15 +++
 include/linux/clk-provider.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 1f903e1f86a2..b0f3b84ebd13 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -286,3 +286,18 @@ err:
kfree(composite);
return clk;
 }
+
+void clk_unregister_composite(struct clk *clk)
+{
+   struct clk_composite *composite;
+   struct clk_hw *hw;
+
+   hw = __clk_get_hw(clk);
+   if (!hw)
+   return;
+
+   composite = to_clk_composite(hw);
+
+   clk_unregister(clk);
+   kfree(composite);
+}
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index da95258127aa..26a8c9b7be71 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -603,6 +603,7 @@ struct clk *clk_register_composite(struct device *dev, 
const char *name,
struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
unsigned long flags);
+void clk_unregister_composite(struct clk *clk);

 /***
  * struct clk_gpio_gate - gpio gated clock
-- 
2.7.3