lkml.org 
[lkml]   [2012]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] drivers: phy: add generic PHY framework
Date
On Wednesday, September 26, 2012 09:57:57 AM Joe Perches wrote:
> On Wed, 2012-09-26 at 20:31 +0530, Kishon Vijay Abraham I wrote:
> > The PHY framework provides a set of API's for the PHY drivers to
> > create/destroy a PHY and API's
>
> Just some trivial notes.
>
> > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
>
> []
>
> > @@ -0,0 +1,445 @@
>
> []
>
> > +static void devm_phy_release(struct device *dev, void *res)
> > +{
> > + struct phy *phy = *(struct phy **)res;
>
> That's a bit twisted isn't it?
> Perhaps
> struct phy *phy = res;

No, because you really need to dereference ptr, not simply cast.

...

> > +
> > + ptr = devres_alloc(devm_phy_release, sizeof(*ptr), GFP_KERNEL);
>
> Is this the right size?
>
> Because ptr is **, perhaps sizeof(struct phy) is clearer.

But incorrect.

Thanks.

--
Dmitry


\
 
 \ /
  Last update: 2012-09-26 20:21    [W:0.087 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site