From patchwork Thu Dec 13 14:54:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 153674 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp917190ljp; Thu, 13 Dec 2018 07:13:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/XW0e1xNd2MAx/9r917Vfa9zzdk9F+K6sJN50BxS2eUM4vh93fJ1mPdpZ+IE2F3p/qahGMC X-Received: by 2002:a37:a942:: with SMTP id s63mr21580133qke.331.1544714021720; Thu, 13 Dec 2018 07:13:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544714021; cv=none; d=google.com; s=arc-20160816; b=JTbd6aeyqExQ5/5TJTqd05nTaa7HFslCHsk64tkO9AMP99gdGChqmc2NvQ+CUEgL2W 6NKcn/yGQMhFV8Qq1/vLQJuvot+OGqt72+MB4pg8TXiJP35q3eoYA/h4KXZMns5bbszq wwzrFzBoVRiSbjc3ymx+1YspdoBUEEZl2/XgTgLbd5A+Nz51zr9mTAKSIXHIluUFjT44 25iUuyJ37kwH3ILlu3o4auteuDhvSeCYeekU7x2Kma6boG250wu8A6DVqEoEZhEXZ5jp fL57afqWs5HAAs3U3a1F5vcXEEFS7bkOuavEvGvmTEX8980glr6B5tKw4frUYiWgCm+z +p9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=8Hqgs29B0uLnia6mtCX/lKApySY/FjLhZnTidN/v7ZU=; b=Q70PzO28bJySQPMVELSgx9n4trFVZpH1lP5XwxaLm89j/9DRDFV2UaB5DkCBqzV7Ex zIsNnZAQiqcQetAFmsl+0RqQJreaG1z1qEWRharZfj0EEgzZY7MaROTVPsabajx1J4fa 1PNIIS1hDUthPeTq1SPk18sb/aqxSH00MLDhsg5840+BeSlK4jce3bDvhyH4HUpYZBrA /fAdmM/o0wAqm/aphqdXnAIWZdBvcjexFwKfR5LyTi/vuMVvi5qV8edGj0KimGtG9CqZ X2Ko1wfzd8JD3caNpZD7mvFld7vf65ANzn1P5lvKxkRlH42wUAmkwBXHN5hokzLRdDJ7 ChRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 188si1223894qki.258.2018.12.13.07.13.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 07:13:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSgH-00051G-4O for patch@linaro.org; Thu, 13 Dec 2018 10:13:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOH-0004C1-GW for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOG-0007JV-JC for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:05 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOG-0006zA-Bj for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:04 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO5-0007IK-6p for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:53 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:21 +0000 Message-Id: <20181213145445.17935-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181213145445.17935-1-peter.maydell@linaro.org> References: <20181213145445.17935-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 13/37] milkymist-hpdmc: Convert sysbus init function to realize function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mao Zhongyi Use DeviceClass rather than SysBusDeviceClass in milkymist_hpdmc_class_init(). Cc: gxt@mprc.pku.edu.cn Cc: michael@walle.cc Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181130093852.20739-12-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/misc/milkymist-hpdmc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.19.2 diff --git a/hw/misc/milkymist-hpdmc.c b/hw/misc/milkymist-hpdmc.c index e6140eec6ba..44dc0698ec8 100644 --- a/hw/misc/milkymist-hpdmc.c +++ b/hw/misc/milkymist-hpdmc.c @@ -129,15 +129,13 @@ static void milkymist_hpdmc_reset(DeviceState *d) | IODELAY_PLL2_LOCKED; } -static int milkymist_hpdmc_init(SysBusDevice *dev) +static void milkymist_hpdmc_realize(DeviceState *dev, Error **errp) { MilkymistHpdmcState *s = MILKYMIST_HPDMC(dev); memory_region_init_io(&s->regs_region, OBJECT(dev), &hpdmc_mmio_ops, s, "milkymist-hpdmc", R_MAX * 4); - sysbus_init_mmio(dev, &s->regs_region); - - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->regs_region); } static const VMStateDescription vmstate_milkymist_hpdmc = { @@ -153,9 +151,8 @@ static const VMStateDescription vmstate_milkymist_hpdmc = { static void milkymist_hpdmc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = milkymist_hpdmc_init; + dc->realize = milkymist_hpdmc_realize; dc->reset = milkymist_hpdmc_reset; dc->vmsd = &vmstate_milkymist_hpdmc; }