Skip to content

Commit

Permalink
vfio: ccw: Register mediated device once all structures are initialized
Browse files Browse the repository at this point in the history
Let's register the mediated device when all the data structures
which could be used are initialized.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <1540487720-11634-3-git-send-email-pmorel@linux.ibm.com>
Acked-by: Halil Pasic <pasic@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
  • Loading branch information
Pierre Morel authored and Cornelia Huck committed Nov 13, 2018
1 parent 52df783 commit 55e93ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/s390/cio/vfio_ccw_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 55e93ec

Please sign in to comment.