From patchwork Thu Dec 13 14:54:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 153665 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp906291ljp; Thu, 13 Dec 2018 07:05:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vb/2Mjs3s1sJE1n09ZkOqApwa7PAyhP5CA+xanWYNKOJtRndrSbD+onyMA9wRpSe8fDeNL X-Received: by 2002:a37:291:: with SMTP id v17mr22406248qkg.208.1544713501004; Thu, 13 Dec 2018 07:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544713501; cv=none; d=google.com; s=arc-20160816; b=q8rMUAHHFKtoLUbbHzrIoptay/1vdzm4PfB9Zk7/m8ZLaZGITkI05cJAJ1M20AnBJH N4u9dic7qhFqQBjEyqLPmmrzj5AI/jkaMVZALY8lZEwjOz1BldCUDe13oLBHG2453IUD AkLmLtAc7ptChQcTS7xJusuudfH8XWlJ71ioDO3MwZYj9Av2pALItLJAejT1kIoTq1K1 fz8G7U95FQOS/Hs7WYF50uD2uGI1TLEGcVjasRXHSxkyd1UFsbsJa5qhOggdSkimik/w tEiUlcl+whCYMgvilW6xunFipKchPf2kAeTtHiiKG+FQSV/ufLvnQEThm/66jhAk0h0O 9VxA== 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=2Ah6M7qX1CgX3pKhxiTaYJizg/D2cxQJIlnmMtBUFdE=; b=lOYWf8VqZeNh9Eep6hX69NraFatIEblWdvojZxVJk8FPl7OonOIgz79gYNcFCq7suw xcJXqhAGapizqodaEnhifPrIG8QYIUd2Ctj8Z6ukIRjigolMs8fJkaQNLoaFmu1Id2pf 6MpTBTBN/gUyuMACz6DH2EeUuBjVW93XDHBrFicwbpy6DZVSIt2bMZQWiIl4N5aILDHQ V5Qaa4mha3E3P57lf5wemQlXv4YdE5CzWxI/ARhQGaQisSNDPcH4clri8pFHy6PuBAx+ 6SASS9JfActmfKiIDhlV9PXB6XUvhbDLwwoXleREZl7zGb22mRspR6sARh7gc8QNDUdu 7pRw== 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 a127si815187qkf.126.2018.12.13.07.05.00 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 07:05:00 -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]:53126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSXs-00054x-F0 for patch@linaro.org; Thu, 13 Dec 2018 10:05:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSOG-0004B5-G7 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSOF-0007Ie-QD for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:04 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53508) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXSOF-00071P-JN for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:55:03 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO4-0007I4-KE for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:52 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:20 +0000 Message-Id: <20181213145445.17935-13-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 12/37] intc/puv3_intc: 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 puv3_intc_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181130093852.20739-11-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/intc/puv3_intc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.19.2 diff --git a/hw/intc/puv3_intc.c b/hw/intc/puv3_intc.c index ef8488aacc4..69ddc8c19ab 100644 --- a/hw/intc/puv3_intc.c +++ b/hw/intc/puv3_intc.c @@ -101,10 +101,10 @@ static const MemoryRegionOps puv3_intc_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static int puv3_intc_init(SysBusDevice *sbd) +static void puv3_intc_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(sbd); PUV3INTCState *s = PUV3_INTC(dev); + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); qdev_init_gpio_in(dev, puv3_intc_handler, PUV3_IRQS_NR); sysbus_init_irq(sbd, &s->parent_irq); @@ -115,15 +115,12 @@ static int puv3_intc_init(SysBusDevice *sbd) memory_region_init_io(&s->iomem, OBJECT(s), &puv3_intc_ops, s, "puv3_intc", PUV3_REGS_OFFSET); sysbus_init_mmio(sbd, &s->iomem); - - return 0; } static void puv3_intc_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); - - sdc->init = puv3_intc_init; + DeviceClass *dc = DEVICE_CLASS(klass); + dc->realize = puv3_intc_realize; } static const TypeInfo puv3_intc_info = {