Commit bd8bb9ae authored by Jason Wang's avatar Jason Wang Committed by Michael S. Tsirkin

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.

Fixes: 6b5df347 ("vDPA/ifcvf: implement management netlink framework for ifcvf")
Tested-by: default avatarZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Message-Id: <20220524055557.1938-1-jasowang@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent baf2ad3f
...@@ -771,7 +771,6 @@ static int ifcvf_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name, ...@@ -771,7 +771,6 @@ static int ifcvf_vdpa_dev_add(struct vdpa_mgmt_dev *mdev, const char *name,
} }
ifcvf_mgmt_dev->adapter = adapter; ifcvf_mgmt_dev->adapter = adapter;
pci_set_drvdata(pdev, ifcvf_mgmt_dev);
vf = &adapter->vf; vf = &adapter->vf;
vf->dev_type = get_dev_type(pdev); 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) ...@@ -886,6 +885,8 @@ static int ifcvf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto err; goto err;
} }
pci_set_drvdata(pdev, ifcvf_mgmt_dev);
return 0; return 0;
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment