Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: octeon: Call SET_NETDEV_DEV()

The Octeon driver calls into PHYLIB which now checks for
net_device->dev.parent, so make sure we do set it before calling into
any MDIO/PHYLIB related function.

Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable <stable@vger.kernel.org> # 4.9+
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Florian Fainelli and committed by
Greg Kroah-Hartman
e7c9a3d9 890b73af

+2
+2
drivers/staging/octeon/ethernet.c
··· 770 770 /* Initialize the device private structure. */ 771 771 struct octeon_ethernet *priv = netdev_priv(dev); 772 772 773 + SET_NETDEV_DEV(dev, &pdev->dev); 773 774 dev->netdev_ops = &cvm_oct_pow_netdev_ops; 774 775 priv->imode = CVMX_HELPER_INTERFACE_MODE_DISABLED; 775 776 priv->port = CVMX_PIP_NUM_INPUT_PORTS; ··· 817 816 } 818 817 819 818 /* Initialize the device private structure. */ 819 + SET_NETDEV_DEV(dev, &pdev->dev); 820 820 priv = netdev_priv(dev); 821 821 priv->netdev = dev; 822 822 priv->of_node = cvm_oct_node_for_port(pip, interface,