[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrCxUfTDmvm9zLXq@smile.fi.intel.com>
Date: Mon, 20 Jun 2022 20:41:37 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Marcin Wojtas <mw@...ihalf.com>
Cc: linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
netdev@...r.kernel.org, rafael@...nel.org, lenb@...nel.org,
andrew@...n.ch, vivien.didelot@...il.com, f.fainelli@...il.com,
olteanv@...il.com, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, linux@...linux.org.uk,
hkallweit1@...il.com, gjb@...ihalf.com, jaz@...ihalf.com,
tn@...ihalf.com, Samer.El-Haj-Mahmoud@....com,
upstream@...ihalf.com
Subject: Re: [net-next: PATCH 03/12] net: dsa: switch to device_/fwnode_ APIs
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?
> + 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().
...
> -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?
...
> - 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.
...
> slave_dev->dev.of_node = port->dn;
> + slave_dev->dev.fwnode = port->fwnode;
device_set_node()
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists