Skip to content

Commit

Permalink
virtio: use virtio_reset_device() when possible
Browse files Browse the repository at this point in the history
This allows us to do common extension without duplicating code.

Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Halil Pasic <[email protected]>
Cc: Cornelia Huck <[email protected]>
Cc: Vineeth Vijayan <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Cc: [email protected]
Reviewed-by: Cornelia Huck <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Xuan Zhuo <[email protected]>
Reviewed-by: Eugenio Pérez <[email protected]>
  • Loading branch information
jasowang authored and mstsirkin committed May 31, 2022
1 parent 2536b2c commit 0aa9683
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/virtio/virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ int register_virtio_device(struct virtio_device *dev)

/* We always start by resetting the device, in case a previous
* driver messed it up. This also tests that code path a little. */
dev->config->reset(dev);
virtio_reset_device(dev);

/* Acknowledge that we've seen the device. */
virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
Expand Down Expand Up @@ -496,7 +496,7 @@ int virtio_device_restore(struct virtio_device *dev)

/* We always start by resetting the device, in case a previous
* driver messed it up. */
dev->config->reset(dev);
virtio_reset_device(dev);

/* Acknowledge that we've seen the device. */
virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
Expand Down

0 comments on commit 0aa9683

Please sign in to comment.