[PATCH 3/3] vDPA/ifcvf: set_status() should get a adapter from the mgmt dev

From
Zhu Lingshan <hidden>
Date
2021-06-30 08:28:02
Also in
kvm
Reply to
Zhu Lingshan, 2021-06-30
ifcvf_vdpa_set_status() should get a adapter from the
management device

Signed-off-by: Zhu Lingshan <redacted>
---
 drivers/vdpa/ifcvf/ifcvf_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c
index 7c2f64ca2163..28c71eef1d2b 100644
--- a/drivers/vdpa/ifcvf/ifcvf_main.c
+++ b/drivers/vdpa/ifcvf/ifcvf_main.c
@@ -212,13 +212,15 @@ static u8 ifcvf_vdpa_get_status(struct vdpa_device *vdpa_dev)
 
 static void ifcvf_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
 {
+	struct ifcvf_vdpa_mgmt_dev *ifcvf_mgmt_dev;
 	struct ifcvf_adapter *adapter;
 	struct ifcvf_hw *vf;
 	u8 status_old;
 	int ret;
 
 	vf  = vdpa_to_vf(vdpa_dev);
-	adapter = dev_get_drvdata(vdpa_dev->dev.parent);
+	ifcvf_mgmt_dev = dev_get_drvdata(vdpa_dev->dev.parent);
+	adapter = ifcvf_mgmt_dev->adapter;
 	status_old = ifcvf_get_status(vf);
 
 	if (status_old == status)
-- 
2.27.0
Thread (12 messages) 12 messages, 4 authors, last reply 2021-07-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help