Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753464AbcDSJxF (ORCPT ); Tue, 19 Apr 2016 05:53:05 -0400 Received: from down.free-electrons.com ([37.187.137.238]:44477 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752571AbcDSJxC (ORCPT ); Tue, 19 Apr 2016 05:53:02 -0400 Date: Tue, 19 Apr 2016 11:52:50 +0200 From: Maxime Ripard To: Stephen Boyd Cc: Mike Turquette , David Airlie , Thierry Reding , Rob Herring , Chen-Yu Tsai , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sunxi@googlegroups.com, Laurent Pinchart , Hans de Goede , Alexander Kaplan , Boris Brezillon , Thomas Petazzoni , Rob Clark Subject: Re: [PATCH v3 01/19] clk: composite: Add unregister function Message-ID: <20160419095250.GA26050@lukather> References: <1458751122-23976-1-git-send-email-maxime.ripard@free-electrons.com> <1458751122-23976-2-git-send-email-maxime.ripard@free-electrons.com> <20160415222856.GQ14441@codeaurora.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <20160415222856.GQ14441@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3171 Lines: 102 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 forc= ed > > us to use clk_unregister directly on it. > >=20 > > 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. > >=20 > > Add a clk_unregister_composite function to fix this. > >=20 > > Signed-off-by: Maxime Ripard > > --- >=20 > 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. >=20 > > drivers/clk/clk-composite.c | 15 +++++++++++++++ > > include/linux/clk-provider.h | 1 + > > 2 files changed, 16 insertions(+) > >=20 > > 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 =3D __clk_get_hw(clk); > > + if (!hw) > > + return; > > + > > + composite =3D to_clk_composite(hw); > > + > > + clk_unregister(clk); > > + kfree(composite); > > +} >=20 > 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 --=20 Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com --4Ckj6UjgE2iN1+kY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXFf/yAAoJEBx+YmzsjxAgsuEP/RROxt3Am9x/hJ/tDdT9x3JH hxAnoBvEP5y6YI6ymvJgKeEYi7nZjG97f7GgIODHMKTfLrtx8RqufD0QW+QgPC5S vm692ea/Dhkn5cAj728MagyGOoZrpJyK5HQCX8/MF14XanwhjDM9EzxES4V4Hmpv Bf+4fb2dtqckvolUb/s9hYDIyWYDgEcqc4lgDnYifx99YeB0tQeUj8Q7FamCkHwg jf8L8+knegi+4urkm8RUMQZ/bpJin7YLG0cc4ghjjVH9RlxhMZmuX7xgKAHYrQVe iTHCgeFK8+SdJsG0B6QmTKRKqveofgNisvuamM2n+T7PGLI6OBjclCbySqKaqhgY DM26MFk384H+ReCRUgFf560875ZZvAiK0NmA00ZnqW9As0HjYd0i2PES+rCZnJhu 79U2uAUZ3rUAx5TVt803TJx4SpI3c5ZwyLkoC2LUu4kXUG00lEdufEfOHKXfQuc1 d5iSiKhHzeYah/L42VxvGnPAdvVmrutk2CRvjolj8Al+nf1q9iPSNNF9SjhLYYyG QOzfXd85aIOdAlIry7x3jrh8EWTWbWNJ9ABO/5hw3fPGt87OLP9Bm8/xMr2oHuaP roCKaZFeD5b+4Jtcne/5n3v4oHg32djo160lOn+SQNQ1gWBjz/caKN3Q+O/H/Din LGsKcnXH/UdRS77eMn/c =Glzr -----END PGP SIGNATURE----- --4Ckj6UjgE2iN1+kY--