Commit 37f1c012 authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky

[S390] Use s390_root_dev_* in kvm_virtio.

No need to define a static device for the kvm_s390 root device,
just use s390_root_dev_register().

This is needed for the bus_id rework
Acked-by: default avatarCarsten Otte <cotte@de.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b9d3aed7
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <asm/kvm_virtio.h> #include <asm/kvm_virtio.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/s390_ext.h> #include <asm/s390_ext.h>
#include <asm/s390_rdev.h>
#define VIRTIO_SUBCODE_64 0x0D00 #define VIRTIO_SUBCODE_64 0x0D00
...@@ -241,10 +242,7 @@ static struct virtio_config_ops kvm_vq_configspace_ops = { ...@@ -241,10 +242,7 @@ static struct virtio_config_ops kvm_vq_configspace_ops = {
* The root device for the kvm virtio devices. * The root device for the kvm virtio devices.
* This makes them appear as /sys/devices/kvm_s390/0,1,2 not /sys/devices/0,1,2. * This makes them appear as /sys/devices/kvm_s390/0,1,2 not /sys/devices/0,1,2.
*/ */
static struct device kvm_root = { static struct device *kvm_root;
.parent = NULL,
.bus_id = "kvm_s390",
};
/* /*
* adds a new device and register it with virtio * adds a new device and register it with virtio
...@@ -261,7 +259,7 @@ static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset) ...@@ -261,7 +259,7 @@ static void add_kvm_device(struct kvm_device_desc *d, unsigned int offset)
return; return;
} }
kdev->vdev.dev.parent = &kvm_root; kdev->vdev.dev.parent = kvm_root;
kdev->vdev.id.device = d->type; kdev->vdev.id.device = d->type;
kdev->vdev.config = &kvm_vq_configspace_ops; kdev->vdev.config = &kvm_vq_configspace_ops;
kdev->desc = d; kdev->desc = d;
...@@ -317,15 +315,16 @@ static int __init kvm_devices_init(void) ...@@ -317,15 +315,16 @@ static int __init kvm_devices_init(void)
if (!MACHINE_IS_KVM) if (!MACHINE_IS_KVM)
return -ENODEV; return -ENODEV;
rc = device_register(&kvm_root); kvm_root = s390_root_dev_register("kvm_s390");
if (rc) { if (IS_ERR(kvm_root)) {
rc = PTR_ERR(kvm_root);
printk(KERN_ERR "Could not register kvm_s390 root device"); printk(KERN_ERR "Could not register kvm_s390 root device");
return rc; return rc;
} }
rc = vmem_add_mapping(PFN_PHYS(max_pfn), PAGE_SIZE); rc = vmem_add_mapping(PFN_PHYS(max_pfn), PAGE_SIZE);
if (rc) { if (rc) {
device_unregister(&kvm_root); s390_root_dev_unregister(kvm_root);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment