From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4360-0007VL-RG for qemu-devel@nongnu.org; Mon, 07 Jul 2014 03:12:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X435u-00046r-UQ for qemu-devel@nongnu.org; Mon, 07 Jul 2014 03:12:16 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:41326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X435u-00046e-Po for qemu-devel@nongnu.org; Mon, 07 Jul 2014 03:12:10 -0400 Received: by mail-wi0-f179.google.com with SMTP id cc10so6155645wib.6 for ; Mon, 07 Jul 2014 00:12:08 -0700 (PDT) From: Eric Auger Date: Mon, 7 Jul 2014 08:08:11 +0100 Message-Id: <1404716892-15600-7-git-send-email-eric.auger@linaro.org> In-Reply-To: <1404716892-15600-1-git-send-email-eric.auger@linaro.org> References: <1404716892-15600-1-git-send-email-eric.auger@linaro.org> Subject: [Qemu-devel] [PATCH 6/7] hw/misc/platform_devices: add call to sysbus fdt_add_node List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, kim.phillips@freescale.com, a.rigo@virtualopensystems.com Cc: peter.maydell@linaro.org, eric.auger@linaro.org, patches@linaro.org, agraf@suse.de, stuart.yoder@freescale.com, alex.williamson@redhat.com, a.motakis@virtualopensystems.com, kvmarm@lists.cs.columbia.edu Creation of the node in the device tree relies on the new sysbus fdt_add_node method. Signed-off-by: Eric Auger --- hw/misc/platform_devices.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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; } -- 1.8.3.2