lkml.org 
[lkml]   [2022]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [net-next: PATCH 02/12] net: mdio: switch fixed-link PHYs API to fwnode_
pon., 20 cze 2022 o 19:32 Andy Shevchenko
<andriy.shevchenko@linux.intel.com> napisał(a):
>
> On Mon, Jun 20, 2022 at 05:02:15PM +0200, Marcin Wojtas wrote:
> > fixed-link PHYs API is used by DSA and a number of drivers
> > and was depending on of_. Switch to fwnode_ so to make it
> > hardware description agnostic and allow to be used in ACPI
> > world as well.
>
> ...
>
> > +bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode)
> > +{
> > + struct fwnode_handle *fixed_link_node;
> > + const char *managed;
> > + int len;
> > +
> > + /* New binding */
> > + fixed_link_node = fwnode_get_named_child_node(fwnode, "fixed-link");
> > + if (fixed_link_node) {
> > + fwnode_handle_put(fixed_link_node);
> > + return true;
> > + }
> > +
> > + if (fwnode_property_read_string(fwnode, "managed", &managed) == 0 &&
> > + strcmp(managed, "auto") != 0)
> > + return true;
> > +
> > + /* Old binding */
> > + len = fwnode_property_read_u32_array(fwnode, "fixed-link", NULL, 0);
>
>
> fwnode_property_count_u32()
>
> > + if (len == (5 * sizeof(u32)))
>
> I'm not sure how to interpret this. len will return a count of u32 elements.
> What does the sizeof(u32) mean here?
>

You are right, thanks for spotting. The total byte count remained
after migrating from of_get_property ->
fwnode_property_read_u32_array.

Best regards,
Marcin

\
 
 \ /
  Last update: 2022-06-21 11:23    [W:0.079 / U:1.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site