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
771 }771 }
772 772
773 ifcvf_mgmt_dev->adapter = adapter;773 ifcvf_mgmt_dev->adapter = adapter;
774 pci_set_drvdata(pdev, ifcvf_mgmt_dev);
775 774
776 vf = &adapter->vf;775 vf = &adapter->vf;
777 vf->dev_type = get_dev_type(pdev);776 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
886 goto err;885 goto err;
887 }886 }
888 887
888 pci_set_drvdata(pdev, ifcvf_mgmt_dev);
889
889 return 0;890 return 0;
890 891
891err:892err:

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