From patchwork Thu May 10 20:08:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 158398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E8F2B6EE7 for ; Fri, 11 May 2012 07:07:50 +1000 (EST) Received: from localhost ([::1]:55468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZg7-0004dH-A9 for incoming@patchwork.ozlabs.org; Thu, 10 May 2012 16:09:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZfK-0002HB-MO for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SSZfI-0003qK-WD for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:46 -0400 Received: from thoth.sbs.de ([192.35.17.2]:19644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SSZfI-0003pk-Kt for qemu-devel@nongnu.org; Thu, 10 May 2012 16:08:44 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id q4AK8g8u023658; Thu, 10 May 2012 22:08:42 +0200 Received: from mchn199C.mchp.siemens.de ([139.22.49.57]) by mail1.siemens.de (8.13.6/8.13.6) with SMTP id q4AK8Tfo009061; Thu, 10 May 2012 22:08:41 +0200 From: Jan Kiszka To: "Michael S. Tsirkin" Date: Thu, 10 May 2012 17:08:21 -0300 Message-Id: <011de1b5a67b8423a66e084bf315acfa62d939b3.1336680504.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.2 Cc: qemu-devel , Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2 05/10] xhci: Clean up reset function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Properly register reset function via the device class. CC: Gerd Hoffmann Signed-off-by: Jan Kiszka --- 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;