diff mbox series

hinic: Link the logical network device to the pci device in sysfs

Message ID 20180723225540.GA6905@xps13.dannf
State Accepted
Commit 7856e8616273098dc6c09a6e084afd98a283ff0d
Headers show
Series hinic: Link the logical network device to the pci device in sysfs | expand

Commit Message

dann frazier July 23, 2018, 10:55 p.m. UTC
Otherwise interfaces get exposed under /sys/devices/virtual, which
doesn't give udev the context it needs for PCI-based predictable
interface names.

Signed-off-by: dann frazier <dann.frazier@canonical.com>

---
 drivers/net/ethernet/huawei/hinic/hinic_main.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.18.0

Comments

David Miller July 25, 2018, 9:01 p.m. UTC | #1
From: dann frazier <dann.frazier@canonical.com>

Date: Mon, 23 Jul 2018 16:55:40 -0600

> Otherwise interfaces get exposed under /sys/devices/virtual, which

> doesn't give udev the context it needs for PCI-based predictable

> interface names.

> 

> Signed-off-by: dann frazier <dann.frazier@canonical.com>


Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 5b122728dcb47..09e9da10b7865 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -983,6 +983,7 @@  static int nic_dev_init(struct pci_dev *pdev)
 	hinic_hwdev_cb_register(nic_dev->hwdev, HINIC_MGMT_MSG_CMD_LINK_STATUS,
 				nic_dev, link_status_event_handler);
 
+	SET_NETDEV_DEV(netdev, &pdev->dev);
 	err = register_netdev(netdev);
 	if (err) {
 		dev_err(&pdev->dev, "Failed to register netdev\n");