Message ID | 20220129160947.11445-1-marek.behun@nic.cz |
---|---|
State | Superseded |
Headers | show |
Series | [5.4] net: sfp: ignore disabled SFP node | expand |
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 7be43a1eaefd..5b2bf7526903 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -582,6 +582,11 @@ static int phylink_register_sfp(struct phylink *pl, return ret; } + if (!fwnode_device_is_available(ref.fwnode)) { + fwnode_handle_put(ref.fwnode); + return 0; + } + pl->sfp_bus = sfp_register_upstream(ref.fwnode, pl, &sfp_phylink_ops); if (!pl->sfp_bus) return -ENOMEM;