Commit 854b1dd9 authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Jon Mason

ntb_netdev: set the net_device's parent

At present, ntb_netdev devices end up under /sys/devices/virtual/net
completely unconnected to the ntb trees below them. This patch sets the
parent of the net_device (using SET_NETDEV_DEV) to the client_dev
device. This results in a better connected sysfs path for the network
device:

/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.1/0000:03:00.1/ntb_netdev0/net/eth2
Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Acked-by: default avatarAllen Hubbe <Allen.Hubbe@dell.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
parent 32e0f5bf
...@@ -418,6 +418,8 @@ static int ntb_netdev_probe(struct device *client_dev) ...@@ -418,6 +418,8 @@ static int ntb_netdev_probe(struct device *client_dev)
if (!ndev) if (!ndev)
return -ENOMEM; return -ENOMEM;
SET_NETDEV_DEV(ndev, client_dev);
dev = netdev_priv(ndev); dev = netdev_priv(ndev);
dev->ndev = ndev; dev->ndev = ndev;
dev->pdev = pdev; dev->pdev = pdev;
......
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