i2c: virtio: Register i2c adapter after virtio queue ready

Make sure the right sequence of virtio i2c access.

Change-Id: I786ee11c5a3166db52531e271a22d53cc607e9a6
Signed-off-by: Yimin Peng <yiminp@codeaurora.org>
This commit is contained in:
Yimin Peng 2020-10-29 16:30:35 +08:00 • committed by Gerrit - the friendly Code Review server
commit 9db1d31388

View file

@ -292,13 +292,14 @@ static int virti2c_probe(struct virtio_device *vdev)
if (err)
goto err_init_vq;
virtio_device_ready(vdev);
virtqueue_enable_cb(vi2c->vq);
err = virti2c_init_hw(vdev, vi2c);
if (err)
goto err_init_hw;
virtio_device_ready(vdev);
virtqueue_enable_cb(vi2c->vq);
return 0;
err_init_hw: