[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPv3WKch9hC3ZjZE0f4JntqFDY04PUpQ1yzsgShThmhkqV01-g@mail.gmail.com>
Date: Tue, 21 Jun 2022 11:27:43 +0200
From: Marcin Wojtas <mw@...ihalf.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, Andrew Lunn <andrew@...n.ch>,
vivien.didelot@...il.com, Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, pabeni@...hat.com,
Russell King - ARM Linux <linux@...linux.org.uk>,
Heiner Kallweit <hkallweit1@...il.com>,
Grzegorz Bernacki <gjb@...ihalf.com>,
Grzegorz Jaszczyk <jaz@...ihalf.com>,
Tomasz Nowicki <tn@...ihalf.com>,
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@....com>,
upstream@...ihalf.com
Subject: Re: [net-next: PATCH 03/12] net: dsa: switch to device_/fwnode_ APIs
pon., 20 cze 2022 o 19:41 Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> napisaĆ(a):
>
> On Mon, Jun 20, 2022 at 05:02:16PM +0200, Marcin Wojtas wrote:
> > In order to support both ACPI and DT, modify the generic
> > DSA code to use device_/fwnode_ equivalent routines.
> > No functional change is introduced by this patch.
>
> ...
>
> > struct device_node *dn;
>
> What prevents us from removing this?
I left it to satisfy possible issues with backward compatibility - I
migrated mv88e6xxx, other DSA drivers still rely on of_* and may use
this field.
>
> > + struct fwnode_handle *fwnode;
>
> ...
>
> > - dn = of_get_child_by_name(ds->dev->of_node, "mdio");
> > + fwnode = fwnode_get_named_child_node(ds->dev->fwnode, "mdio");
>
> The rule of thumb is avoid dereferencing fwnode from struct device. So
> dev_fwnode(), but here it would be achieved by device_get_named_child_node().
>
Ok, thanks - will do for all occurences.
> ...
>
> > -static int dsa_switch_parse_of(struct dsa_switch *ds, struct device_node *dn)
> > +static int dsa_switch_parse_of(struct dsa_switch *ds, struct fwnode_handle *fwnode)
>
> Shouldn't _of suffix be replaced by, let's say, _fw?
>
I thought about it and can perform such naming update in next iteration.
> ...
>
> > - return dsa_switch_parse_ports_of(ds, dn);
> > + return dsa_switch_parse_ports_of(ds, fwnode);
>
> Ditto.
>
> ...
>
> > + fwnode = ds->dev->fwnode;
>
> dev_fwnode() or corresponding device_property_ API.
>
OK.
> ...
>
> > slave_dev->dev.of_node = port->dn;
> > + slave_dev->dev.fwnode = port->fwnode;
>
> device_set_node()
>
OK.
Thanks,
Marcin
Powered by blists - more mailing lists