From patchwork Mon Feb 4 13:44:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14534 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 11BA723FEE for ; Mon, 4 Feb 2013 13:44:49 +0000 (UTC) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by fiordland.canonical.com (Postfix) with ESMTP id BF3C3A18276 for ; Mon, 4 Feb 2013 13:44:48 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fl17so3904367vcb.13 for ; Mon, 04 Feb 2013 05:44:48 -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=bqKQBHl3PJ5ovjJvIHKN5hBwOow5uzp35Qd6T+rMJ3I=; b=LNI4IJJntyKXezwDSQFazrhzo+tw2Q+FYkq7g/Gk3g4/GNS9c/AYhJPRDO4bh9mtNx iKsiSCvEfy+WlaXUgSzIeymTLZcJ8zjA+zNNXMfcajN0AhDBuCHWx/QEtsgn7+N3vtjC HGrX7x5eWo0h/V1xJWEzp089Y7cq5s8HI3zgKIjb919m44Dcy7ivWkiRo6LG2QpHs1bS X42xuIfdIxYth/LbeBYVwcGd2Djzf4FNRJoYgfaXu0OGsewcfNfvz30rAQ+1Ft5rvDeu sld378tbHp5dAmlWRuYDsIAXT24ltAZ667cauARvE4ZUCmgCXpUOJoN7d5jpmgb0bp4/ FgsA== X-Received: by 10.58.232.226 with SMTP id tr2mr18254798vec.48.1359985488257; Mon, 04 Feb 2013 05:44:48 -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.252.8 with SMTP id zo8csp87655vec; Mon, 4 Feb 2013 05:44:47 -0800 (PST) X-Received: by 10.66.88.37 with SMTP id bd5mr53048048pab.75.1359985482178; Mon, 04 Feb 2013 05:44:42 -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 d8si4382397paz.48.2013.02.04.05.44.40 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 04 Feb 2013 05:44:41 -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 1U2MLd-0007eT-9A; Mon, 04 Feb 2013 13:44:37 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Anthony Liguori Subject: [PATCH 05/10] hw/arm_sysctl: Convert from qdev init to instance_init Date: Mon, 4 Feb 2013 13:44:31 +0000 Message-Id: <1359985476-29380-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1359985476-29380-1-git-send-email-peter.maydell@linaro.org> References: <1359985476-29380-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQmpIzqn9I7+frHHBUcOu8QBPuXzR+PC5wiWCnBvGMc9/vU+zszSfZaA3g4eZd+L3n0STnLd 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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c index bb56238..ecee6fe 100644 --- a/hw/arm_sysctl.c +++ b/hw/arm_sysctl.c @@ -525,15 +525,15 @@ 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) { + SysBusDevice *dev = SYS_BUS_DEVICE(obj); arm_sysctl_state *s = FROM_SYSBUS(arm_sysctl_state, dev); 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; } static Property arm_sysctl_properties[] = { @@ -545,9 +545,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 +555,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, };