lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250901113814.xiscq26yefs3t4qr@DEN-DL-M70577>
Date: Mon, 1 Sep 2025 11:38:14 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Rosen Penev <rosenp@...il.com>
CC: <netdev@...r.kernel.org>, <horatiu.vultur@...rochip.com>
Subject: Re: [PATCH net-next 2/2] net: lan966x: convert fwnode to of

> > > @@ -1179,7 +1179,7 @@ static int lan966x_probe(struct platform_device *pdev)
> > >                 }
> > >         }
> > >
> > > -       ports = device_get_named_child_node(&pdev->dev, "ethernet-ports");
> > > +       ports = of_get_child_by_name(pdev->dev.of_node, "ethernet-ports");
> > >         if (!ports)
> > >                 return dev_err_probe(&pdev->dev, -ENODEV,
> > >                                      "no ethernet-ports child found\n");
> > > @@ -1191,25 +1191,27 @@ static int lan966x_probe(struct platform_device *pdev)
> > >         lan966x_stats_init(lan966x);
> > >
> > >         /* go over the child nodes */
> > > -       fwnode_for_each_available_child_node(ports, portnp) {
> > > +       for_each_available_child_of_node(ports, portnp) {
> > >                 phy_interface_t phy_mode;
> > >                 struct phy *serdes;
> > >                 u32 p;
> > >
> > > -               if (fwnode_property_read_u32(portnp, "reg", &p))
> > > +               if (of_property_read_u32(portnp, "reg", &p))
> > >                         continue;
> > >
> > > -               phy_mode = fwnode_get_phy_mode(portnp);
> > > -               err = lan966x_probe_port(lan966x, p, phy_mode, portnp);
> > > +               err = of_get_phy_mode(portnp, &phy_mode);
> > > +               if (err)
> > > +                       goto cleanup_ports;
> > > +
> > > +               err = lan966x_probe_port(lan966x, p, phy_mode, of_fwnode_handle(portnp));
> >
> > As I see it, you could change the signature of lan966x_probe_port() to accept a
> > struct device_node, and instead pass that.  Then you can convert it to fwnode
> > for phylink_create, and ditch to_of_node().
> Will fix.

Thanks.

> >
> > Same goes for lan966x_port_parse_delays(), here you can change
> > fwnode_for_each_available_child_node() to for_each_available_child_of_node()
> > and fwnode_property_read_u32() to of_property_read_u32().
> I don't see this lan966x_port_parse_delays function.

Sorry, I was looking at an internal version that had this function. Disregard
this. The first comment still applies though.

/Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ