diff options
author | David Woodhouse <dwmw2@infradead.org> | 2008-02-03 08:29:41 +0100 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2008-02-03 08:30:32 +0100 |
commit | c1f3ee120bb61045b1c0a3ead620d1d65af47130 (patch) | |
tree | 908430bf2b47fe8e96ac623ae7ab6dd5698d0938 /drivers/virtio/virtio.c | |
parent | [MTD] Unlocking all Intel flash that is locked on power up. (diff) | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 (diff) | |
download | linux-c1f3ee120bb61045b1c0a3ead620d1d65af47130.tar.xz linux-c1f3ee120bb61045b1c0a3ead620d1d65af47130.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Diffstat (limited to 'drivers/virtio/virtio.c')
-rw-r--r-- | drivers/virtio/virtio.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 15d7787dea87..69d7ea02cd48 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -96,10 +96,23 @@ static int virtio_dev_probe(struct device *_d) return err; } +static int virtio_dev_remove(struct device *_d) +{ + struct virtio_device *dev = container_of(_d,struct virtio_device,dev); + struct virtio_driver *drv = container_of(dev->dev.driver, + struct virtio_driver, driver); + + dev->config->set_status(dev, dev->config->get_status(dev) + & ~VIRTIO_CONFIG_S_DRIVER); + drv->remove(dev); + return 0; +} + int register_virtio_driver(struct virtio_driver *driver) { driver->driver.bus = &virtio_bus; driver->driver.probe = virtio_dev_probe; + driver->driver.remove = virtio_dev_remove; return driver_register(&driver->driver); } EXPORT_SYMBOL_GPL(register_virtio_driver); |