All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	qemu-arm@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Helge Deller" <deller@gmx.de>,
	"Oscar Alejandro Sánchez Lucero" <aleszlucero@gmail.com>
Subject: [PATCH 02/11] hw/usb/hcd-ehci-pci: Convert to Resettable interface
Date: Mon, 30 Nov 2026 20:02:44 +0000	[thread overview]
Message-ID: <20261130-b4-usb-resettable-v1-2-2ee503f50c8a@gmail.com> (raw)
In-Reply-To: <20261130-b4-usb-resettable-v1-0-2ee503f50c8a@gmail.com>

Replace the transitional device_class_set_legacy_reset() wrapper with
the ResettableClass interface by implementing the hold phase in
usb_ehci_pci_reset_hold().

Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
 hw/usb/hcd-ehci-pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index fd35d25..31bee22 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -111,10 +111,9 @@ static void usb_ehci_pci_exit(PCIDevice *dev)
     s->irq = NULL;
 }
 
-static void usb_ehci_pci_reset(DeviceState *dev)
+static void usb_ehci_pci_reset_hold(Object *obj, ResetType type)
 {
-    PCIDevice *pci_dev = PCI_DEVICE(dev);
-    EHCIPCIState *i = PCI_EHCI(pci_dev);
+    EHCIPCIState *i = PCI_EHCI(obj);
     EHCIState *s = &i->ehci;
 
     ehci_reset(s);
@@ -154,6 +153,7 @@ static void ehci_class_init(ObjectClass *klass, const void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
     k->realize = usb_ehci_pci_realize;
     k->exit = usb_ehci_pci_exit;
@@ -161,7 +161,7 @@ static void ehci_class_init(ObjectClass *klass, const void *data)
     k->config_write = usb_ehci_pci_write_config;
     dc->vmsd = &vmstate_ehci_pci;
     device_class_set_props(dc, ehci_pci_properties);
-    device_class_set_legacy_reset(dc, usb_ehci_pci_reset);
+    rc->phases.hold = usb_ehci_pci_reset_hold;
 }
 
 static const TypeInfo ehci_pci_type_info = {

-- 
2.53.0



  parent reply	other threads:[~2026-11-30 20:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 20:02 [PATCH 00/11] hw/usb: Convert USB host controllers and PHY to Resettable interface Oscar Alejandro Sánchez Lucero
2026-11-30 20:02 ` [PATCH 01/11] hw/usb/hcd-dwc3: Convert " Oscar Alejandro Sánchez Lucero
2026-12-01 13:47   ` Bin Meng
2026-12-01 14:46   ` Tommaso Califano
2026-12-01 21:38   ` Philippe Mathieu-Daudé
2026-11-30 20:02 ` Oscar Alejandro Sánchez Lucero [this message]
2026-12-01 13:47   ` [PATCH 02/11] hw/usb/hcd-ehci-pci: " Bin Meng
2026-12-01 14:47   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 03/11] hw/usb/hcd-ehci-sysbus: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:47   ` Bin Meng
2026-12-01 14:47   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 04/11] hw/usb/hcd-ohci-pci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:48   ` Bin Meng
2026-12-01 14:48   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 05/11] hw/usb/hcd-ohci-sysbus: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:48   ` Bin Meng
2026-12-01 14:49   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 06/11] hw/usb/hcd-uhci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49   ` Bin Meng
2026-12-01 14:51   ` Tommaso Califano
2026-12-01 14:52   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 07/11] hw/usb/hcd-xhci-pci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49   ` Bin Meng
2026-12-01 14:53   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 08/11] hw/usb/hcd-xhci-sysbus: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:49   ` Bin Meng
2026-12-01 14:54   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 09/11] hw/usb/hcd-xhci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:50   ` Bin Meng
2026-12-01 14:55   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 10/11] hw/usb/imx-usb-phy: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:50   ` Bin Meng
2026-12-01 14:58   ` Tommaso Califano
2026-11-30 20:02 ` [PATCH 11/11] hw/usb/pc87560-ohci: " Oscar Alejandro Sánchez Lucero
2026-12-01 13:50   ` Bin Meng
2026-12-01 14:59   ` Tommaso Califano

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=20261130-b4-usb-resettable-v1-2-2ee503f50c8a@gmail.com \
    --to=aleszlucero@gmail.com \
    --cc=deller@gmx.de \
    --cc=jcd@tribudubois.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.