Skip to contentSkip to conversation

vfio: ccw: Register mediated device once all structures are initialized

PATCH Superseded Pierre Morel 1 participant 1 message Oct 25, 2018

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 vfio: ccw: Register mediated device once all structures are initialized

Let's register the mediated device when all the data structures which could be used are initialized.

---
 drivers/s390/cio/vfio_ccw_drv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/s390/cio/vfio_ccw_drv.c +4 -4
index f47d16b5810b..33fd53f49bf2 100644
@@ -134,14 +134,14 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
 	if (ret)
 		goto out_free;
 
-	ret = vfio_ccw_mdev_reg(sch);
-	if (ret)
-		goto out_disable;
-
 	INIT_WORK(&private->io_work, vfio_ccw_sch_io_todo);
 	atomic_set(&private->avail, 1);
 	private->state = VFIO_CCW_STATE_STANDBY;
 
+	ret = vfio_ccw_mdev_reg(sch);
+	if (ret)
+		goto out_disable;
+
 	return 0;
 
 out_disable:
Signature · 1 line
2.17.0