hinic: Link the logical network device to the pci device in sysfs
authordann frazier <dann.frazier@canonical.com>
Mon, 23 Jul 2018 22:55:40 +0000 (16:55 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jul 2018 20:54:52 +0000 (13:54 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/huawei/hinic/hinic_main.c

index 5b122728dcb472c9f9849cb2a82a08e5b4917cca..09e9da10b786549b6232d8069c4e45857b95fd8c 100644 (file)
@@ -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");