diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-02-04 23:50:05 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-02-04 07:50:06 -0500 |
commit | c6fd47011b4bdebad3f1513bac75fe4895e332ee (patch) | |
tree | 12224cdb2594be26e02291b142ba6e1e2c1c8122 /drivers/virtio | |
parent | 15f9c8903cbdb02aee0f1bcf86a97c2e238b9a3d (diff) |
virtio: Allow virtio to be modular and used by modules
This is needed for the virtio PCI device to be compiled as a module.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/Kconfig | 4 | ||||
-rw-r--r-- | drivers/virtio/virtio.c | 8 | ||||
-rw-r--r-- | drivers/virtio/virtio_ring.c | 4 |
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig index 9e33fc4da875..de0c8c2654ef 100644 --- a/drivers/virtio/Kconfig +++ b/drivers/virtio/Kconfig | |||
@@ -1,8 +1,8 @@ | |||
1 | # Virtio always gets selected by whoever wants it. | 1 | # Virtio always gets selected by whoever wants it. |
2 | config VIRTIO | 2 | config VIRTIO |
3 | bool | 3 | tristate |
4 | 4 | ||
5 | # Similarly the virtio ring implementation. | 5 | # Similarly the virtio ring implementation. |
6 | config VIRTIO_RING | 6 | config VIRTIO_RING |
7 | bool | 7 | tristate |
8 | depends on VIRTIO | 8 | depends on VIRTIO |
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 7dddb1860936..b535483bc556 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c | |||
@@ -162,4 +162,12 @@ static int virtio_init(void) | |||
162 | panic("virtio bus registration failed"); | 162 | panic("virtio bus registration failed"); |
163 | return 0; | 163 | return 0; |
164 | } | 164 | } |
165 | |||
166 | static void __exit virtio_exit(void) | ||
167 | { | ||
168 | bus_unregister(&virtio_bus); | ||
169 | } | ||
165 | core_initcall(virtio_init); | 170 | core_initcall(virtio_init); |
171 | module_exit(virtio_exit); | ||
172 | |||
173 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 74c245092b5c..3a28c1382131 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c | |||
@@ -266,6 +266,7 @@ irqreturn_t vring_interrupt(int irq, void *_vq) | |||
266 | 266 | ||
267 | return IRQ_HANDLED; | 267 | return IRQ_HANDLED; |
268 | } | 268 | } |
269 | EXPORT_SYMBOL_GPL(vring_interrupt); | ||
269 | 270 | ||
270 | static struct virtqueue_ops vring_vq_ops = { | 271 | static struct virtqueue_ops vring_vq_ops = { |
271 | .add_buf = vring_add_buf, | 272 | .add_buf = vring_add_buf, |
@@ -318,9 +319,12 @@ struct virtqueue *vring_new_virtqueue(unsigned int num, | |||
318 | 319 | ||
319 | return &vq->vq; | 320 | return &vq->vq; |
320 | } | 321 | } |
322 | EXPORT_SYMBOL_GPL(vring_new_virtqueue); | ||
321 | 323 | ||
322 | void vring_del_virtqueue(struct virtqueue *vq) | 324 | void vring_del_virtqueue(struct virtqueue *vq) |
323 | { | 325 | { |
324 | kfree(to_vvq(vq)); | 326 | kfree(to_vvq(vq)); |
325 | } | 327 | } |
328 | EXPORT_SYMBOL_GPL(vring_del_virtqueue); | ||
326 | 329 | ||
330 | MODULE_LICENSE("GPL"); | ||