From patchwork Mon May 10 20:51:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 52232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1B3F2B7D6B for ; Tue, 11 May 2010 06:58:59 +1000 (EST) Received: from localhost ([127.0.0.1]:38864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBa3z-0001CT-DR for incoming@patchwork.ozlabs.org; Mon, 10 May 2010 16:58:55 -0400 Received: from [140.186.70.92] (port=46967 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBZwQ-0005yn-IP for qemu-devel@nongnu.org; Mon, 10 May 2010 16:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBZwN-0005nK-A5 for qemu-devel@nongnu.org; Mon, 10 May 2010 16:51:06 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:50773) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBZwM-0005mz-34 for qemu-devel@nongnu.org; Mon, 10 May 2010 16:51:03 -0400 Received: by pwj9 with SMTP id 9so1620425pwj.4 for ; Mon, 10 May 2010 13:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=9IgW1ZCa9b8xHOciuXvznihwPU9XuXKm5hO6XjTu1mg=; b=eJvX3DUinHOIHOi1wXm7rLoBa77jpF3TC1uM/7aCisScxQMVJEopIVo84BkWdEEUtY 1RJO7f/DjEroXx3215TPzKD9JGiMiCE5W9yXekMtaCxRHOQQcdLdMQHmsVvEdwZPAGNF /CdAqrl3HgY80kFbkh+oj9YZ/c2zfesn3QPI4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=igS/nNWa5RWrDeSz0v10gr6CcLheb2tau7lIEXlDHnnibSVX2CmTDj1sp06auMNA1O i+UHcmYBl5+FLoZCQ57eMDQMrR7sWt9tX/k0uufLEoMh9F/x73W2wxAvCGq9oiTta6Bu kBeXUvmySkD5d8QPvs+JfoaaCt8Jl2NAZiDm0= MIME-Version: 1.0 Received: by 10.140.87.23 with SMTP id k23mr3056174rvb.108.1273524660794; Mon, 10 May 2010 13:51:00 -0700 (PDT) Received: by 10.141.44.12 with HTTP; Mon, 10 May 2010 13:51:00 -0700 (PDT) Date: Mon, 10 May 2010 23:51:00 +0300 Message-ID: From: Blue Swirl To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 1/2] acpi: remove static pm_state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Blue Swirl --- hw/acpi.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371AB_3); @@ -747,6 +744,7 @@ static void disable_device(struct pci_status *p, struct gpe_regs *g, int slot) static int piix4_device_hotplug(PCIDevice *dev, int state) { + PIIX4PMState *s = container_of(dev, PIIX4PMState, dev); int slot = PCI_SLOT(dev->devfn); pci0_status.up = 0; @@ -756,8 +754,8 @@ static int piix4_device_hotplug(PCIDevice *dev, int state) else disable_device(&pci0_status, &gpe, slot); if (gpe.en & 2) { - qemu_set_irq(pm_state->irq, 1); - qemu_set_irq(pm_state->irq, 0); + qemu_set_irq(s->irq, 1); + qemu_set_irq(s->irq, 0); } return 0; } diff --git a/hw/acpi.c b/hw/acpi.c index e3b63b7..bb2974e 100644 --- a/hw/acpi.c +++ b/hw/acpi.c @@ -76,8 +76,6 @@ typedef struct PIIX4PMState { #define SMBHSTDAT1 0x06 #define SMBBLKDAT 0x07 -static PIIX4PMState *pm_state; - static uint32_t get_pmtmr(PIIX4PMState *s) { uint32_t d; @@ -509,7 +507,6 @@ i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s = (PIIX4PMState *)pci_register_device(bus, "PM", sizeof(PIIX4PMState), devfn, NULL, pm_write_config); - pm_state = s; pci_conf = s->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);