diff mbox

[6/7] hw/misc/platform_devices: add call to sysbus fdt_add_node

Message ID 1404716892-15600-7-git-send-email-eric.auger@linaro.org
State New
Headers show

Commit Message

Auger Eric July 7, 2014, 7:08 a.m. UTC
Creation of the node in the device tree relies on the new sysbus
fdt_add_node method.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
 hw/misc/platform_devices.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/hw/misc/platform_devices.c b/hw/misc/platform_devices.c
index 96ab272..a054606 100644
--- a/hw/misc/platform_devices.c
+++ b/hw/misc/platform_devices.c
@@ -9,7 +9,8 @@  int sysbus_device_create_devtree(Object *obj, void *opaque)
     PlatformDevtreeData *data = opaque;
     Object *dev;
     SysBusDevice *sbdev;
-    bool matched = false;
+    SysBusDeviceClass *k;
+
 
     dev = object_dynamic_cast(obj, TYPE_SYS_BUS_DEVICE);
     sbdev = (SysBusDevice *)dev;
@@ -19,12 +20,8 @@  int sysbus_device_create_devtree(Object *obj, void *opaque)
         return object_child_foreach(obj, sysbus_device_create_devtree, data);
     }
 
-    if (!matched) {
-        error_report("Device %s is not supported by this machine yet.",
-                     qdev_fw_name(DEVICE(dev)));
-        exit(1);
-    }
-
+    k = SYS_BUS_DEVICE_GET_CLASS(dev);
+    k->fdt_add_node(sbdev, data);
     return 0;
 }