vfio: Move vfio_device driver open/close code to a function
This error unwind is getting complicated. Move all the code into two
pair'd function. The functions should be called when the open_count == 1
after incrementing/before decrementing.
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Yi Liu <[email protected]>
Reviewed-by: Alex Williamson <[email protected]>
Tested-by: Alex Williamson <[email protected]>
Tested-by: Yi Liu <[email protected]>
Tested-by: Nicolin Chen <[email protected]>
Tested-by: Lixiao Yang <[email protected]>
Tested-by: Matthew Rosato <[email protected]>
Tested-by: Yu He <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>