diff options
Diffstat (limited to 'target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch')
-rw-r--r-- | target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch b/target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch index 92fe224873..82c9fa53c2 100644 --- a/target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch +++ b/target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch @@ -16,7 +16,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -565,26 +565,17 @@ static const struct sfp_upstream_ops sfp +@@ -565,31 +565,17 @@ static const struct sfp_upstream_ops sfp static int phylink_register_sfp(struct phylink *pl, struct fwnode_handle *fwnode) { @@ -42,6 +42,11 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> 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; @@ -59,7 +64,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> #include <linux/rtnetlink.h> #include <linux/slab.h> -@@ -520,45 +521,63 @@ static void sfp_upstream_clear(struct sf +@@ -520,45 +521,68 @@ static void sfp_upstream_clear(struct sf } /** @@ -117,6 +122,11 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> + else if (ret < 0) + return ERR_PTR(ret); + ++ if (!fwnode_device_is_available(ref.fwnode)) { ++ fwnode_handle_put(ref.fwnode); ++ return NULL; ++ } ++ + bus = sfp_bus_get(ref.fwnode); + fwnode_handle_put(ref.fwnode); + if (!bus) |