From patchwork Thu Dec 13 14:54:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 153659 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp898502ljp; Thu, 13 Dec 2018 06:59:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/XsBQUnYYIXPgmVdRvVN630rqo8goqWzv+jukAX7RyH0Va6/+Sqhl9zBsYHdE/Y/V+sDlQz X-Received: by 2002:aed:2e86:: with SMTP id k6mr23242905qtd.292.1544713144703; Thu, 13 Dec 2018 06:59:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544713144; cv=none; d=google.com; s=arc-20160816; b=jaM22t3ITC5ZBMfj5hYt/skgkzeiCf1NIKp5/C4Un9UjDUfFEnnFvHjI/6RIX68LIu 6ESTOLEug0CdG3Es/uogOXBo+NtKzxlSHjYWNm2PnTpA7HFoygkps1s8FGtZ2MvwXIwb WUtBwdVqlIVQJ2F8LxEZwwrLXnrMzRo9Qjvo5SeYURn43RTKV4fSx/0BvXJL6rE8h1A9 CMWPipN7J9McLFmGlqBMU+5+nj8dKs8SaJDr7iGIue0t7K8ZN3EijOX2+wZDWaAa47VF jQyK5nfz9KG7yhPqTq2W5iKWGzsFegHwloCMICEbNe/wfwrk80QDEmjJ12gyS7Nvg1FM IHNw== 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=On+017VhBH8HLy3os1CwkMG5VxFviKFtE81GGwsowLU=; b=SNGzdtrldxLnnapGEXNEBlZaNh/CHITPwzSnIE66KzH0m6jVx+XuduFrcuCl8vTie9 XOft5zegMV5b21Rg1J4lO2WAds6zPQZ4MPn41Cd8r5fud9WDLFVGjPclWIyUnjSpFQQM F4MbEo2T0sNX/tjcc4bBepxGNvoKvsVcrDeSV8VBYhK2mD+utHF9/iXC0Sa0vD7kM+1r CaDYo8wid4vowvpELaaitw5bir8kHDdRACbSTa7SxWWgp21Dvx2hCr0FOUD2P7664vhV cEJUEArhRKTZU919hVbhOF52q8QwMkQ67wtaxp79wXmvb5TYfMBoMJmLPf5m4haPQaWO 4ezw== 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 l6si1132149qve.146.2018.12.13.06.59.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 13 Dec 2018 06:59:04 -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]:53090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSS8-00087y-6V for patch@linaro.org; Thu, 13 Dec 2018 09:59:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXSO5-0003zb-5B for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXSO3-00073L-L0 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:52 -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 1gXSO3-00071P-C3 for qemu-devel@nongnu.org; Thu, 13 Dec 2018 09:54:51 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gXSO2-0007Gu-9J for qemu-devel@nongnu.org; Thu, 13 Dec 2018 14:54:50 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Dec 2018 14:54:16 +0000 Message-Id: <20181213145445.17935-9-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 08/37] dma/puv3_dma: 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_dma_class_init(). Cc: gxt@mprc.pku.edu.cn Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181130093852.20739-7-maozhongyi@cmss.chinamobile.com Signed-off-by: Peter Maydell --- hw/dma/puv3_dma.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.19.2 diff --git a/hw/dma/puv3_dma.c b/hw/dma/puv3_dma.c index b97a6c1767c..c89eade0292 100644 --- a/hw/dma/puv3_dma.c +++ b/hw/dma/puv3_dma.c @@ -76,7 +76,7 @@ static const MemoryRegionOps puv3_dma_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static int puv3_dma_init(SysBusDevice *dev) +static void puv3_dma_realize(DeviceState *dev, Error **errp) { PUV3DMAState *s = PUV3_DMA(dev); int i; @@ -87,16 +87,14 @@ static int puv3_dma_init(SysBusDevice *dev) memory_region_init_io(&s->iomem, OBJECT(s), &puv3_dma_ops, s, "puv3_dma", PUV3_REGS_OFFSET); - sysbus_init_mmio(dev, &s->iomem); - - return 0; + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); } static void puv3_dma_class_init(ObjectClass *klass, void *data) { - SysBusDeviceClass *sdc = SYS_BUS_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); - sdc->init = puv3_dma_init; + dc->realize = puv3_dma_realize; } static const TypeInfo puv3_dma_info = {