s390x: simplify virtio_ccw_reset_virtio
Call virtio_bus_reset instead of virtio_reset, so that the function need not receive the VirtIODevice. Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f55ba8018c
commit
997340f3c5
|
@ -249,12 +249,12 @@ static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBlock *info,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void virtio_ccw_reset_virtio(VirtioCcwDevice *dev, VirtIODevice *vdev)
|
||||
static void virtio_ccw_reset_virtio(VirtioCcwDevice *dev)
|
||||
{
|
||||
CcwDevice *ccw_dev = CCW_DEVICE(dev);
|
||||
|
||||
virtio_ccw_stop_ioeventfd(dev);
|
||||
virtio_reset(vdev);
|
||||
virtio_bus_reset(&dev->bus);
|
||||
if (dev->indicators) {
|
||||
release_indicator(&dev->routes.adapter, dev->indicators);
|
||||
dev->indicators = NULL;
|
||||
|
@ -359,7 +359,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
|
|||
ret = virtio_ccw_handle_set_vq(sch, ccw, check_len, dev->revision < 1);
|
||||
break;
|
||||
case CCW_CMD_VDEV_RESET:
|
||||
virtio_ccw_reset_virtio(dev, vdev);
|
||||
virtio_ccw_reset_virtio(dev);
|
||||
ret = 0;
|
||||
break;
|
||||
case CCW_CMD_READ_FEAT:
|
||||
|
@ -536,7 +536,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
|
|||
}
|
||||
if (virtio_set_status(vdev, status) == 0) {
|
||||
if (vdev->status == 0) {
|
||||
virtio_ccw_reset_virtio(dev, vdev);
|
||||
virtio_ccw_reset_virtio(dev);
|
||||
}
|
||||
if (status & VIRTIO_CONFIG_S_DRIVER_OK) {
|
||||
virtio_ccw_start_ioeventfd(dev);
|
||||
|
@ -921,10 +921,9 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t vector)
|
|||
static void virtio_ccw_reset(DeviceState *d)
|
||||
{
|
||||
VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d);
|
||||
VirtIODevice *vdev = virtio_bus_get_device(&dev->bus);
|
||||
VirtIOCCWDeviceClass *vdc = VIRTIO_CCW_DEVICE_GET_CLASS(dev);
|
||||
|
||||
virtio_ccw_reset_virtio(dev, vdev);
|
||||
virtio_ccw_reset_virtio(dev);
|
||||
if (vdc->parent_reset) {
|
||||
vdc->parent_reset(d);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue