qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 1/2] acpi: remove static pm_state
Date: Mon, 10 May 2010 23:51:00 +0300	[thread overview]
Message-ID: <v2sf43fc5581005101351p4d9ee160qd57bfc63de52e435@mail.gmail.com> (raw)

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/acpi.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

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);
     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;
 }
-- 
1.6.2.4

                 reply	other threads:[~2010-05-10 20:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v2sf43fc5581005101351p4d9ee160qd57bfc63de52e435@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).