From patchwork Mon Feb 25 16:44:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 15068 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9EA4923E02 for ; Mon, 25 Feb 2013 16:44:41 +0000 (UTC) Received: from mail-vb0-f41.google.com (mail-vb0-f41.google.com [209.85.212.41]) by fiordland.canonical.com (Postfix) with ESMTP id 689EDA180BD for ; Mon, 25 Feb 2013 16:44:41 +0000 (UTC) Received: by mail-vb0-f41.google.com with SMTP id l22so1822491vbn.28 for ; Mon, 25 Feb 2013 08:44:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=LStTxjKbsrHG3H3yb/MEsDahQhM0St95UOHBa1I/85g=; b=ZoSRD+DRbQDJamm6o+0Dks75jMjQz7fiSRVMZjZ3gjFcVgjMJ+mqxZDhCOFM/Y+xRo lA1Fy/hHVAderCvhS0GtZWKsQtDCOz5pHAxcqDaYSJXuiRL3sMJcCeTQhuRQQEjjwUEP KpngtcYTdEBq/wrkcMTQ456ota0TwpBokOB7kG5AYcPZ1inpMjY7wD72vVzf1jnEXVj0 GT1QOYkgwmvK46HFALeelK47lLD8r5Xm4W9PSBeshe/eCkJ7CJWLe0p+UqN5YLdR89Xj WI/tBgJ1BdHkoJ4Q5vbIbWf0N1ml92SWdME0iHKkN0dJkrc2ME8VZ0N2lX2BlUaXFHjS Nfeg== X-Received: by 10.220.149.82 with SMTP id s18mr10213303vcv.14.1361810680892; Mon, 25 Feb 2013 08:44:40 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp67550veb; Mon, 25 Feb 2013 08:44:40 -0800 (PST) X-Received: by 10.14.179.194 with SMTP id h42mr40210616eem.46.1361810677030; Mon, 25 Feb 2013 08:44:37 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id a9si22029526eem.179.2013.02.25.08.44.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 25 Feb 2013 08:44:36 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1UA1AH-0006ta-CX; Mon, 25 Feb 2013 16:44:33 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori Subject: [PATCH v2 05/10] hw/arm_sysctl: Convert from qdev init to instance_init Date: Mon, 25 Feb 2013 16:44:28 +0000 Message-Id: <1361810673-26473-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1361810673-26473-1-git-send-email-peter.maydell@linaro.org> References: <1361810673-26473-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQkrM2fIzfo8JQyh+fYM1Mej2EzVkjy8GbX+KXVmxPQjy2bwSj+RAZiv7iT6CbaDQvJ44FBh Convert this device from old-style qdev init to an instance_init function. We don't need a realize function yet, though. Signed-off-by: Peter Maydell --- hw/arm_sysctl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c index bb56238..6d135ac 100644 --- a/hw/arm_sysctl.c +++ b/hw/arm_sysctl.c @@ -525,15 +525,16 @@ static void arm_sysctl_gpio_set(void *opaque, int line, int level) } } -static int arm_sysctl_init(SysBusDevice *dev) +static void arm_sysctl_init(Object *obj) { - arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, dev); + DeviceState *dev = DEVICE(obj); + SysBusDevice *sd = SYS_BUS_DEVICE(obj); + arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, sd); memory_region_init_io(&s->iomem, &arm_sysctl_ops, s, "arm-sysctl", 0x1000); - sysbus_init_mmio(dev, &s->iomem); - qdev_init_gpio_in(&s->busdev.qdev, arm_sysctl_gpio_set, 2); - qdev_init_gpio_out(&s->busdev.qdev, &s->pl110_mux_ctrl, 1); - return 0; + sysbus_init_mmio(sd, &s->iomem); + qdev_init_gpio_in(dev, arm_sysctl_gpio_set, 2); + qdev_init_gpio_out(dev, &s->pl110_mux_ctrl, 1); } static Property arm_sysctl_properties[] = { @@ -545,9 +546,7 @@ static Property arm_sysctl_properties[] = { static void arm_sysctl_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = arm_sysctl_init; dc->reset = arm_sysctl_reset; dc->vmsd = &vmstate_arm_sysctl; dc->props = arm_sysctl_properties; @@ -557,6 +556,7 @@ static const TypeInfo arm_sysctl_info = { .name = "realview_sysctl", .parent = TYPE_SYS_BUS_DEVICE, .instance_size = sizeof(arm_sysctl_state), + .instance_init = arm_sysctl_init, .class_init = arm_sysctl_class_init, };