lkml.org 
[lkml]   [2020]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link()
Date


> -----Original Message-----
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> Subject: Re: [PATCH v1 5/7] device property: Introduce
> fwnode_phy_is_fixed_link()
>
> On Fri, Jan 31, 2020 at 5:38 PM Calvin Johnson <calvin.johnson@nxp.com>
> wrote:
> >
> > From: Calvin Johnson <calvin.johnson@oss.nxp.com>
> >
> > Introduce fwnode_phy_is_fixed_link() function that an Ethernet driver
> > can call on its PHY phandle to find out whether it's a fixed link PHY
> > or not.
>
> > +/*
> > + * fwnode_phy_is_fixed_link()
> > + */
>
> Please, do a full kernel doc description.

Sure will take care in v2.


> > +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode) {
> > + struct fwnode_handle *fixed_node;
> > + int len, err;
> > + const char *managed;
> > +
> > + fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link");
> > + if (fixed_node)
> > + return fixed_node;
> > +
> > + err = fwnode_property_read_string(fixed_node, "managed",
> > + &managed);
>
> > + if (err == 0 && strcmp(managed, "auto") != 0)
> > + return true;
> > +
> > + return false;
>
> Maybe other way around?
>
> if (err)
> return false;
>
> return !strcmp(managed, "auto");
>
> ?
>
> Same pattern perhaps for the patch where you introduce
> fwnode_get_phy_mode().

Thanks! Will take care in v2.

Regards
Calvin

\
 
 \ /
  Last update: 2020-02-03 10:22    [W:0.108 / U:1.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site