patch "staging: octeon: repair "fixed-link" support" added to staging-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
staging: octeon: repair "fixed-link" support
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 179f5dc36b0a1aa31538d7d8823deb65c39847b3 Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <[email protected]>
Date: Fri, 16 Oct 2020 12:18:57 +0200
Subject: staging: octeon: repair "fixed-link" support
The PHYs must be registered once in device probe function, not in device open callback because it's only possible to register them once.
--- drivers/staging/octeon/ethernet-mdio.c | 6 ------ drivers/staging/octeon/ethernet.c | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-)
drivers/staging/octeon/ethernet-mdio.c +0 -6
@@ -147,12 +147,6 @@ int cvm_oct_phy_setup_device(struct net_device *dev) phy_node =of_parse_phandle (priv->of_node,"phy-handle" ,0 );if (!phy_node &&of_phy_is_fixed_link (priv->of_node)) { -int rc; - - rc =of_phy_register_fixed_link (priv->of_node); -if (rc) -return rc; - phy_node =of_node_get (priv->of_node); }if (!phy_node)
drivers/staging/octeon/ethernet.c +9 -0
@@ -13,6 +13,7 @@#include <linux/phy.h> #include <linux/slab.h> #include <linux/interrupt.h> +#include <linux/of_mdio.h> #include <linux/of_net.h> #include <linux/if_ether.h> #include <linux/if_vlan.h>
@@ -892,6 +893,14 @@ static int cvm_oct_probe(struct platform_device *pdev)break ; } +if (priv->of_node &&of_phy_is_fixed_link (priv->of_node)) { +if (of_phy_register_fixed_link (priv->of_node)) { +netdev_err (dev,"Failed to register fixed link for interface %d, port %d\n" , + interface, priv->port); + dev->netdev_ops =NULL ; + } + } +if (!dev->netdev_ops) {free_netdev (dev); }else if (register_netdev (dev) <0 ) {
Signature · 1 line
2.29.1