History

vdpa: ifcvf: set pci driver data in probe

We should set the pci driver data in probe instead of the vdpa device adding callback. Otherwise if no vDPA device is created we will lose the pointer to the management device.

Jason Wang committed 4 years ago

Commit bd8bb9a1 parent baf2ad31 file · +2 −1Browse files

Unified · Split

drivers/vdpa/ifcvf/ifcvf_main.c+2−1
@@ -771,7 +771,6 @@ static int ifcvf_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name, · 770 unmodified lines
771771 }
772772
773773 ifcvf_mgmt_dev->adapter = adapter;
774− pci_set_drvdata(pdev, ifcvf_mgmt_dev);
775774
776775 vf = &adapter->vf;
777776 vf->dev_type = get_dev_type(pdev);
@@ -886,6 +885,8 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 108 unmodified lines
886885 goto err;
887886 }
888887
888+ pci_set_drvdata(pdev, ifcvf_mgmt_dev);
889+
889890 return 0;
890891
891892 err:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t