Commit 97699056 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

rocker: set physical device for port netdevice

Do this so the sysfs has "device" link correctly set.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b9375b5
...@@ -2534,7 +2534,7 @@ static void rocker_port_dev_addr_init(struct rocker_port *rocker_port) ...@@ -2534,7 +2534,7 @@ static void rocker_port_dev_addr_init(struct rocker_port *rocker_port)
#define ROCKER_PORT_MAX_MTU 9000 #define ROCKER_PORT_MAX_MTU 9000
static int rocker_probe_port(struct rocker *rocker, unsigned int port_number) static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
{ {
const struct pci_dev *pdev = rocker->pdev; struct pci_dev *pdev = rocker->pdev;
struct rocker_port *rocker_port; struct rocker_port *rocker_port;
struct net_device *dev; struct net_device *dev;
int err; int err;
...@@ -2542,6 +2542,7 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number) ...@@ -2542,6 +2542,7 @@ static int rocker_probe_port(struct rocker *rocker, unsigned int port_number)
dev = alloc_etherdev(sizeof(struct rocker_port)); dev = alloc_etherdev(sizeof(struct rocker_port));
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
SET_NETDEV_DEV(dev, &pdev->dev);
rocker_port = netdev_priv(dev); rocker_port = netdev_priv(dev);
rocker_port->dev = dev; rocker_port->dev = dev;
rocker_port->rocker = rocker; rocker_port->rocker = rocker;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment