[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221105163751.it2mxwobzhqwtyr4@skbuf>
Date: Sat, 5 Nov 2022 18:37:51 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: piergiorgio.beruto@...il.com
Cc: netdev@...r.kernel.org
Subject: Re: Potential issue with PHYs connected to the same MDIO bus and
different MACs
On Sat, Nov 05, 2022 at 03:39:07PM +0100, piergiorgio.beruto@...il.com wrote:
> priv->phylink_config.dev = &pdev->dev;
> priv->phylink_config.type = PHYLINK_NETDEV;
The problem is here. You think that &pdev->dev is the same as
&ndev->dev, but it isn't (and it's SET_NETDEV_DEV that makes the linkage
between the 2). Use &ndev->dev here, and check out how phylink uses the
"dev" field:
#define to_net_dev(d) container_of(d, struct net_device, dev)
if (config->type == PHYLINK_NETDEV) {
pl->netdev = to_net_dev(config->dev);
Powered by blists - more mailing lists