]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/virtio/virtio_balloon.c
via-velocity: add velocity_set_rxbufsize helper
[linux-2.6-omap-h63xx.git] / drivers / virtio / virtio_balloon.c
index 622aece1acce38153759a8b2b8bc925d6291aca6..bfef604160d16460062f46b84f16c9320579c0d4 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/swap.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
+#include <linux/delay.h>
 
 struct virtio_balloon
 {
@@ -151,12 +152,12 @@ static void virtballoon_changed(struct virtio_device *vdev)
        wake_up(&vb->config_change);
 }
 
-static inline int towards_target(struct virtio_balloon *vb)
+static inline s64 towards_target(struct virtio_balloon *vb)
 {
        u32 v;
-       __virtio_config_val(vb->vdev,
-                           offsetof(struct virtio_balloon_config, num_pages),
-                           &v);
+       vb->vdev->config->get(vb->vdev,
+                             offsetof(struct virtio_balloon_config, num_pages),
+                             &v, sizeof(v));
        return v - vb->num_pages;
 }
 
@@ -175,7 +176,7 @@ static int balloon(void *_vballoon)
 
        set_freezable();
        while (!kthread_should_stop()) {
-               int diff;
+               s64 diff;
 
                try_to_freeze();
                wait_event_interruptible(vb->config_change,
@@ -226,7 +227,7 @@ static int virtballoon_probe(struct virtio_device *vdev)
        }
 
        vb->tell_host_first
-               = vdev->config->feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
+               = virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
 
        return 0;
 
@@ -258,7 +259,11 @@ static void virtballoon_remove(struct virtio_device *vdev)
        kfree(vb);
 }
 
+static unsigned int features[] = { VIRTIO_BALLOON_F_MUST_TELL_HOST };
+
 static struct virtio_driver virtio_balloon = {
+       .feature_table = features,
+       .feature_table_size = ARRAY_SIZE(features),
        .driver.name =  KBUILD_MODNAME,
        .driver.owner = THIS_MODULE,
        .id_table =     id_table,