aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
Diffstat (limited to 'net/9p')
-rw-r--r--net/9p/trans_virtio.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 7853c31bd690..c957080966b4 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -385,6 +385,18 @@ static struct p9_trans *p9_virtio_create(const char *devname, char *args)
385 return trans; 385 return trans;
386} 386}
387 387
388static void p9_virtio_remove(struct virtio_device *vdev)
389{
390 struct virtio_chan *chan = vdev->priv;
391
392 BUG_ON(chan->inuse);
393
394 if (chan->initialized) {
395 vdev->config->del_vq(chan->vq);
396 chan->initialized = false;
397 }
398}
399
388#define VIRTIO_ID_9P 9 400#define VIRTIO_ID_9P 9
389 401
390static struct virtio_device_id id_table[] = { 402static struct virtio_device_id id_table[] = {
@@ -398,6 +410,7 @@ static struct virtio_driver p9_virtio_drv = {
398 .driver.owner = THIS_MODULE, 410 .driver.owner = THIS_MODULE,
399 .id_table = id_table, 411 .id_table = id_table,
400 .probe = p9_virtio_probe, 412 .probe = p9_virtio_probe,
413 .remove = p9_virtio_remove,
401}; 414};
402 415
403static struct p9_trans_module p9_virtio_trans = { 416static struct p9_trans_module p9_virtio_trans = {
@@ -419,7 +432,13 @@ static int __init p9_virtio_init(void)
419 return register_virtio_driver(&p9_virtio_drv); 432 return register_virtio_driver(&p9_virtio_drv);
420} 433}
421 434
435static void __exit p9_virtio_cleanup(void)
436{
437 unregister_virtio_driver(&p9_virtio_drv);
438}
439
422module_init(p9_virtio_init); 440module_init(p9_virtio_init);
441module_exit(p9_virtio_cleanup);
423 442
424MODULE_DEVICE_TABLE(virtio, id_table); 443MODULE_DEVICE_TABLE(virtio, id_table);
425MODULE_AUTHOR("Eric Van Hensbergen <ericvh@gmail.com>"); 444MODULE_AUTHOR("Eric Van Hensbergen <ericvh@gmail.com>");