Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f39335453fe79f4e12e263e7c6387dc9fb86bfff
Commit:     f39335453fe79f4e12e263e7c6387dc9fb86bfff
Parent:     dea7bbb603735ceceb07bb370eca17198faf7c8d
Author:     Eric Van Hensbergen <[EMAIL PROTECTED](none)>
AuthorDate: Wed Feb 6 19:25:04 2008 -0600
Committer:  Eric Van Hensbergen <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 19:25:04 2008 -0600

    9p: add remove function to trans_virtio
    
    Request from rusty:
    Just cleaning up patches for 2.6.25 merge, and noticed that
    net/9p/trans_virtio.c doesn't have a remove function.  This will crash when
    removing the module (console doesn't have one because it can't really be
    removed).
    
    Signed-off-by: Eric Van Hensbergen <[EMAIL PROTECTED]>
---
 net/9p/trans_virtio.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 7853c31..c957080 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)
        return trans;
 }
 
+static void p9_virtio_remove(struct virtio_device *vdev)
+{
+       struct virtio_chan *chan = vdev->priv;
+
+       BUG_ON(chan->inuse);
+
+       if (chan->initialized) {
+               vdev->config->del_vq(chan->vq);
+               chan->initialized = false;
+       }
+}
+
 #define VIRTIO_ID_9P 9
 
 static struct virtio_device_id id_table[] = {
@@ -398,6 +410,7 @@ static struct virtio_driver p9_virtio_drv = {
        .driver.owner = THIS_MODULE,
        .id_table =     id_table,
        .probe =        p9_virtio_probe,
+       .remove =       p9_virtio_remove,
 };
 
 static struct p9_trans_module p9_virtio_trans = {
@@ -419,7 +432,13 @@ static int __init p9_virtio_init(void)
        return register_virtio_driver(&p9_virtio_drv);
 }
 
+static void __exit p9_virtio_cleanup(void)
+{
+       unregister_virtio_driver(&p9_virtio_drv);
+}
+
 module_init(p9_virtio_init);
+module_exit(p9_virtio_cleanup);
 
 MODULE_DEVICE_TABLE(virtio, id_table);
 MODULE_AUTHOR("Eric Van Hensbergen <[EMAIL PROTECTED]>");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to