summaryrefslogtreecommitdiffstats
path: root/drivers/net/ntb_netdev.c
diff options
context:
space:
mode:
authorLogan Gunthorpe <logang@deltatee.com>2017-06-05 14:00:51 -0600
committerJon Mason <jdmason@kudzu.us>2017-07-06 11:30:08 -0400
commit854b1dd9c39d8c8c8647a44de47ef18506ae11f9 (patch)
tree25bd4a7ecda672c882bcd8e224a90fc34a3cc565 /drivers/net/ntb_netdev.c
parent32e0f5bfa5aa2a74264160e0990df3af125ca6e2 (diff)
downloadlinux-854b1dd9c39d8c8c8647a44de47ef18506ae11f9.tar.gz
linux-854b1dd9c39d8c8c8647a44de47ef18506ae11f9.tar.bz2
linux-854b1dd9c39d8c8c8647a44de47ef18506ae11f9.zip
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: Logan Gunthorpe <logang@deltatee.com> Acked-by: Allen Hubbe <Allen.Hubbe@dell.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
Diffstat (limited to 'drivers/net/ntb_netdev.c')
-rw-r--r--drivers/net/ntb_netdev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c
index 4daf3d0926a8..0250aa9ae2cb 100644
--- a/drivers/net/ntb_netdev.c
+++ b/drivers/net/ntb_netdev.c
@@ -418,6 +418,8 @@ static int ntb_netdev_probe(struct device *client_dev)
if (!ndev)
return -ENOMEM;
+ SET_NETDEV_DEV(ndev, client_dev);
+
dev = netdev_priv(ndev);
dev->ndev = ndev;
dev->pdev = pdev;