net: stmmac: Fallback to dev_fwnode() if needed
When CONFIG_OF is not enabled, of_fwnode_handle() will return NULL, even though we can have a FW handle from a given device. Fallback to dev_fwnode() helper if needed. Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
422829f9f8
commit
8dc6051ce3
|
@ -1043,6 +1043,9 @@ static int stmmac_phy_setup(struct stmmac_priv *priv)
|
|||
priv->phylink_config.dev = &priv->dev->dev;
|
||||
priv->phylink_config.type = PHYLINK_NETDEV;
|
||||
|
||||
if (!fwnode)
|
||||
fwnode = dev_fwnode(priv->device);
|
||||
|
||||
phylink = phylink_create(&priv->phylink_config, fwnode,
|
||||
mode, &stmmac_phylink_mac_ops);
|
||||
if (IS_ERR(phylink))
|
||||
|
|
Loading…
Reference in New Issue