qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v2 05/10] xhci: Clean up reset function
Date: Thu, 10 May 2012 17:08:21 -0300	[thread overview]
Message-ID: <011de1b5a67b8423a66e084bf315acfa62d939b3.1336680504.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1336680504.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1336680504.git.jan.kiszka@siemens.com>

Properly register reset function via the device class.

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/usb/hcd-xhci.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index c4079eb..814117c 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2339,9 +2339,9 @@ static void xhci_reset_full(XHCIState *xhci)
     xhci->ev_buffer_get = 0;
 }
 
-static void xhci_reset(void *opaque)
+static void xhci_reset(DeviceState *dev)
 {
-    XHCIState *xhci = opaque;
+    XHCIState *xhci = DO_UPCAST(XHCIState, pci_dev.qdev, dev);
 
     msi_reset(&xhci->pci_dev);
     xhci_reset_full(xhci);
@@ -2838,8 +2838,6 @@ static void usb_xhci_init(XHCIState *xhci, DeviceState *dev)
     for (i = 0; i < MAXSLOTS; i++) {
         xhci->slots[i].enabled = 0;
     }
-
-    qemu_register_reset(xhci_reset, xhci);
 }
 
 static int usb_xhci_initfn(struct PCIDevice *dev)
@@ -2902,6 +2900,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
 
     dc->vmsd    = &vmstate_xhci;
     dc->props   = xhci_properties;
+    dc->reset   = xhci_reset;
     k->init         = usb_xhci_initfn;
     k->vendor_id    = PCI_VENDOR_ID_NEC;
     k->device_id    = PCI_DEVICE_ID_NEC_UPD720200;
-- 
1.7.3.4

  parent reply	other threads:[~2012-05-10 20:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10 20:08 [Qemu-devel] [PATCH v2 00/10] msi: Refactorings and reset fixes Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 01/10] ahci: Fix reset of MSI function Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 02/10] intel-hda: " Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 03/10] xhci: " Jan Kiszka
2012-05-11  8:16   ` Gerd Hoffmann
2012-05-11 13:07     ` Jan Kiszka
2012-05-11 13:19       ` Gerd Hoffmann
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 04/10] ahci: Clean up reset functions Jan Kiszka
2012-05-10 20:08 ` Jan Kiszka [this message]
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 06/10] msi: Guard msi_reset with msi_present Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 07/10] msi: Invoke msi/msix_reset from PCI core Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 08/10] msi: Guard msi/msix_write_config with msi_present Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 09/10] msi: Invoke msi/msix_write_config from PCI core Jan Kiszka
2012-05-10 20:08 ` [Qemu-devel] [PATCH v2 10/10] msi: Use msi/msix_present more consistently Jan Kiszka

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=011de1b5a67b8423a66e084bf315acfa62d939b3.1336680504.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.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).