diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-30 13:20:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-30 13:20:03 -0400 |
commit | ab8cd81830fef799177740d5ab709c0341e9ba5c (patch) | |
tree | 40c27d1cd27a436ec195174a105fa27c223ed6dd /drivers/s390 | |
parent | f8356ed00ebcdc2f209504c02b4ab8ba9a8a7ebe (diff) | |
parent | 20887611523e749d99cc7d64ff6c97d27529fbae (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
lguest: notify on empty
virtio: force callback on empty.
virtio_blk: fix endianess annotations
virtio_config: fix len calculation of config elements
virtio_net: another race with virtio_net and enable_cb
virtio: An entropy device, as suggested by hpa.
virtio_blk: allow read-only disks
lguest: fix ugly <NULL> in /proc/interrupts
virtio: set device index in common code.
virtio: virtio_pci should not set bus_id.
virtio: bus_id for devices should contain 'virtio'
Fix crash in virtio_blk during modprobe ; rmmod ; modprobe
lguest: use ioremap_cache, not ioremap
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/kvm/kvm_virtio.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c index 9f55ce6f3c78..5ab34340919b 100644 --- a/drivers/s390/kvm/kvm_virtio.c +++ b/drivers/s390/kvm/kvm_virtio.c | |||
@@ -31,11 +31,6 @@ | |||
31 | */ | 31 | */ |
32 | static void *kvm_devices; | 32 | static void *kvm_devices; |
33 | 33 | ||
34 | /* | ||
35 | * Unique numbering for kvm devices. | ||
36 | */ | ||
37 | static unsigned int dev_index; | ||
38 | |||
39 | struct kvm_device { | 34 | struct kvm_device { |
40 | struct virtio_device vdev; | 35 | struct virtio_device vdev; |
41 | struct kvm_device_desc *desc; | 36 | struct kvm_device_desc *desc; |
@@ -250,26 +245,25 @@ static struct device kvm_root = { | |||
250 | * adds a new device and register it with virtio | 245 | * adds a new device and register it with virtio |
251 | * appropriate drivers are loaded by the device model | 246 | * appropriate drivers are loaded by the device model |
252 | */ | 247 | */ |
253 | static void add_kvm_device(struct kvm_device_desc *d) | 248 | static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset) |
254 | { | 249 | { |
255 | struct kvm_device *kdev; | 250 | struct kvm_device *kdev; |
256 | 251 | ||
257 | kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); | 252 | kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); |
258 | if (!kdev) { | 253 | if (!kdev) { |
259 | printk(KERN_EMERG "Cannot allocate kvm dev %u\n", | 254 | printk(KERN_EMERG "Cannot allocate kvm dev %u type %u\n", |
260 | dev_index++); | 255 | offset, d->type); |
261 | return; | 256 | return; |
262 | } | 257 | } |
263 | 258 | ||
264 | kdev->vdev.dev.parent = &kvm_root; | 259 | kdev->vdev.dev.parent = &kvm_root; |
265 | kdev->vdev.index = dev_index++; | ||
266 | kdev->vdev.id.device = d->type; | 260 | kdev->vdev.id.device = d->type; |
267 | kdev->vdev.config = &kvm_vq_configspace_ops; | 261 | kdev->vdev.config = &kvm_vq_configspace_ops; |
268 | kdev->desc = d; | 262 | kdev->desc = d; |
269 | 263 | ||
270 | if (register_virtio_device(&kdev->vdev) != 0) { | 264 | if (register_virtio_device(&kdev->vdev) != 0) { |
271 | printk(KERN_ERR "Failed to register kvm device %u\n", | 265 | printk(KERN_ERR "Failed to register kvm device %u type %u\n", |
272 | kdev->vdev.index); | 266 | offset, d->type); |
273 | kfree(kdev); | 267 | kfree(kdev); |
274 | } | 268 | } |
275 | } | 269 | } |
@@ -289,7 +283,7 @@ static void scan_devices(void) | |||
289 | if (d->type == 0) | 283 | if (d->type == 0) |
290 | break; | 284 | break; |
291 | 285 | ||
292 | add_kvm_device(d); | 286 | add_kvm_device(d, i); |
293 | } | 287 | } |
294 | } | 288 | } |
295 | 289 | ||