Skip to content

Commit 2148927

Browse files
elkablodavem330
authored andcommitted
net: sfp: ignore disabled SFP node
Commit ce0aa27 ("sfp: add sfp-bus to bridge between network devices and sfp cages") added code which finds SFP bus DT node even if the node is disabled with status = "disabled". Because of this, when phylink is created, it ends with non-null .sfp_bus member, even though the SFP module is not probed (because the node is disabled). We need to ignore disabled SFP bus node. Fixes: ce0aa27 ("sfp: add sfp-bus to bridge between network devices and sfp cages") Signed-off-by: Marek Behún <[email protected]> Cc: [email protected] # 2203cbf ("net: sfp: move fwnode parsing into sfp-bus layer") Signed-off-by: David S. Miller <[email protected]>
1 parent afa114d commit 2148927

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/phy/sfp-bus.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
651651
else if (ret < 0)
652652
return ERR_PTR(ret);
653653

654+
if (!fwnode_device_is_available(ref.fwnode)) {
655+
fwnode_handle_put(ref.fwnode);
656+
return NULL;
657+
}
658+
654659
bus = sfp_bus_get(ref.fwnode);
655660
fwnode_handle_put(ref.fwnode);
656661
if (!bus)

0 commit comments

Comments
 (0)