From patchwork Mon Dec 18 15:12:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 850119 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UKxf2MBD"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z0l5k5htgz9s82 for ; Tue, 19 Dec 2017 02:17:46 +1100 (AEDT) Received: from localhost ([::1]:46788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQxAm-0000BI-TO for incoming@patchwork.ozlabs.org; Mon, 18 Dec 2017 10:17:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQx7G-0005zB-V5 for qemu-devel@nongnu.org; Mon, 18 Dec 2017 10:14:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQx6Q-0000xn-Vy for qemu-devel@nongnu.org; Mon, 18 Dec 2017 10:14:06 -0500 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:42287) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQx6M-0000wA-J0; Mon, 18 Dec 2017 10:13:10 -0500 Received: by mail-qt0-x244.google.com with SMTP id g9so20369985qth.9; Mon, 18 Dec 2017 07:13:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=58UWNiTsKb2DS8wj3MUUc1bomt4VCJOBOOmfdstU4wM=; b=UKxf2MBDGvLGvCEbtBX5vIR7dL+chOSn5StKbn4/ekOfdTZe/UCDBRoKoY4pHAc/2V 5TVmjAKPJjm3FH4fSjBxT2KBqHEAR/Dhryy5uz9PAH0fLZwgFuID7DGjGhDQJ8Yk2VSl CMvvLAy9izDXqu4WxLez3dpW69IEKyOQSUQdDatf8BC9U/eXEUb5b56CnoWebtC4+Azd M2lMoBu15dS8O2pkehXJzJhQ38nYeTxOlPAGGl1jVkJaOMWd8EHx5040rKOQJsMXo7NE Ymk6GbHYPjP7Y0FE+5evdQnz5TqtC5LcPYx31KglGh+Ba9Ixll62SfPtQprIM5jTmnTl 0+0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=58UWNiTsKb2DS8wj3MUUc1bomt4VCJOBOOmfdstU4wM=; b=RKQmHR40cKL1bI5q91uHwzb0MtplF5a7sZmHDajxiSATq9CnS8A+/vsvFC36KZBYvk O1r/52lVNU65dlgsOA+S9+yDJA5Au05mI3ukvQzAFydRq/97Z0uKPn3yp3fsblHePzqC ZpfSsd2Fj0AH8ou94nUddpPs4NswoTykj1dcZqNfQRbQLVNVxoakQmtgLnmeMo3/pTBm akj8u5hnA7p+XDIBrRIy+sphzxq5aTaLbZu4X55UPBaMNzRb7tgNdPO82xyBzpyBlwfQ bw4woa4u/0BF0W06gjivoMdkk3b2VJY6xfTu2s4RCNzjf+5Ep6VwRuLylCadgxam+JD/ zYYg== X-Gm-Message-State: AKGB3mI02/japG+R4xqUp7yRagQmfkOMGlpNvxGvEDf6GeDSix/i5X4D IuAZ1zJK8YRIvBu+NBwue78= X-Google-Smtp-Source: ACJfBotNwfJhfUjAhY//ekkhy5vTO7mDASLVTMhNkPwG2v/CAMoIRy3gIciByptrzd+Nreb0Udtlkg== X-Received: by 10.200.3.23 with SMTP id q23mr227555qtg.229.1513609987724; Mon, 18 Dec 2017 07:13:07 -0800 (PST) Received: from x1.local ([138.117.48.211]) by smtp.gmail.com with ESMTPSA id y16sm8334022qta.48.2017.12.18.07.13.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 07:13:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: "Michael S. Tsirkin" , Marcel Apfelbaum , Eduardo Habkost Date: Mon, 18 Dec 2017 12:12:44 -0300 Message-Id: <20171218151244.9975-5-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171218151244.9975-1-f4bug@amsat.org> References: <20171218151244.9975-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH v2 4/4] hw/pci: remove obsolete PCIDevice->init() 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: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All PCI devices are now QOM'ified. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marcel Apfelbaum --- v2: added Marcel's R-b include/hw/pci/pci.h | 1 - hw/pci/pci.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 8d02a0a383..0f1ed64c2f 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -217,7 +217,6 @@ typedef struct PCIDeviceClass { DeviceClass parent_class; void (*realize)(PCIDevice *dev, Error **errp); - int (*init)(PCIDevice *dev);/* TODO convert to realize() and remove */ PCIUnregisterFunc *exit; PCIConfigReadFunc *config_read; PCIConfigWriteFunc *config_write; diff --git a/hw/pci/pci.c b/hw/pci/pci.c index b2d139bd9a..cd25ab6f6b 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2054,18 +2054,6 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp) } } -static void pci_default_realize(PCIDevice *dev, Error **errp) -{ - PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); - - if (pc->init) { - if (pc->init(dev) < 0) { - error_setg(errp, "Device initialization failed"); - return; - } - } -} - PCIDevice *pci_create_multifunction(PCIBus *bus, int devfn, bool multifunction, const char *name) { @@ -2538,13 +2526,11 @@ MemoryRegion *pci_address_space_io(PCIDevice *dev) static void pci_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k = DEVICE_CLASS(klass); - PCIDeviceClass *pc = PCI_DEVICE_CLASS(klass); k->realize = pci_qdev_realize; k->unrealize = pci_qdev_unrealize; k->bus_type = TYPE_PCI_BUS; k->props = pci_props; - pc->realize = pci_default_realize; } static void pci_device_class_base_init(ObjectClass *klass, void *data)