Commit 55e93ecd authored by Pierre Morel's avatar Pierre Morel Committed by Cornelia Huck
Browse files

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.

Signed-off-by: default avatarPierre Morel <pmorel@linux.ibm.com>
Reviewed-by: default avatarEric Farman <farman@linux.ibm.com>
Message-Id: <1540487720-11634-3-git-send-email-pmorel@linux.ibm.com>
Acked-by: default avatarHalil Pasic <pasic@linux.ibm.com>
Signed-off-by: default avatarCornelia Huck <cohuck@redhat.com>
parent 52df7837
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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: