qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Sai Pavan Boddu" <sai.pavan.boddu@xilinx.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON
Date: Sat,  7 Nov 2020 12:13:05 +0100	[thread overview]
Message-ID: <20201107111307.262263-4-philmd@redhat.com> (raw)
In-Reply-To: <20201107111307.262263-1-philmd@redhat.com>

Follow the code base style by using the _COMMON suffix to
abstract QOM types.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/usb/hcd-xhci.h        |  4 +++-
 include/hw/usb/xhci.h    |  1 -
 hw/usb/hcd-xhci-pci.c    |  2 +-
 hw/usb/hcd-xhci-sysbus.c |  2 +-
 hw/usb/hcd-xhci.c        | 10 +++++-----
 5 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h
index ccf50ae28be..7bd10964f92 100644
--- a/hw/usb/hcd-xhci.h
+++ b/hw/usb/hcd-xhci.h
@@ -27,7 +27,9 @@
 #include "hw/usb/xhci.h"
 #include "sysemu/dma.h"
 
-OBJECT_DECLARE_SIMPLE_TYPE(XHCIState, XHCI)
+#define TYPE_XHCI_COMMON "base-xhci" /* Common to PCI and Sysbus */
+
+OBJECT_DECLARE_SIMPLE_TYPE(XHCIState, XHCI_COMMON)
 
 /* Very pessimistic, let's hope it's enough for all cases */
 #define EV_QUEUE (((3 * 24) + 16) * XHCI_MAXSLOTS)
diff --git a/include/hw/usb/xhci.h b/include/hw/usb/xhci.h
index 5c90e1373e5..90b56429199 100644
--- a/include/hw/usb/xhci.h
+++ b/include/hw/usb/xhci.h
@@ -1,7 +1,6 @@
 #ifndef HW_USB_XHCI_H
 #define HW_USB_XHCI_H
 
-#define TYPE_XHCI "base-xhci"
 #define TYPE_NEC_XHCI "nec-usb-xhci"
 #define TYPE_QEMU_XHCI "qemu-xhci"
 #define TYPE_XHCI_SYSBUS "sysbus-xhci"
diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c
index b78fcd2bb2d..2ca018a4290 100644
--- a/hw/usb/hcd-xhci-pci.c
+++ b/hw/usb/hcd-xhci-pci.c
@@ -193,7 +193,7 @@ static void xhci_instance_init(Object *obj)
      * line, therefore, no need to wait to realize like other devices
      */
     PCI_DEVICE(obj)->cap_present |= QEMU_PCI_CAP_EXPRESS;
-    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI);
+    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI_COMMON);
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
 }
 
diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index 29185d2261f..f2ec08ffa4e 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -58,7 +58,7 @@ static void xhci_sysbus_instance_init(Object *obj)
 {
     XHCISysbusState *s = XHCI_SYSBUS(obj);
 
-    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI);
+    object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI_COMMON);
     qdev_alias_all_properties(DEVICE(&s->xhci), obj);
 
     object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 57b692ad849..3abe416dfd6 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -2637,7 +2637,7 @@ static void xhci_port_reset(XHCIPort *port, bool warm_reset)
 
 static void xhci_reset(DeviceState *dev)
 {
-    XHCIState *xhci = XHCI(dev);
+    XHCIState *xhci = XHCI_COMMON(dev);
     int i;
 
     trace_usb_xhci_reset();
@@ -2891,7 +2891,7 @@ static uint64_t xhci_oper_read(void *ptr, hwaddr reg, unsigned size)
 static void xhci_oper_write(void *ptr, hwaddr reg,
                             uint64_t val, unsigned size)
 {
-    XHCIState *xhci = XHCI(ptr);
+    XHCIState *xhci = XHCI_COMMON(ptr);
 
     trace_usb_xhci_oper_write(reg, val);
 
@@ -3327,7 +3327,7 @@ static void usb_xhci_realize(DeviceState *dev, Error **errp)
 {
     int i;
 
-    XHCIState *xhci = XHCI(dev);
+    XHCIState *xhci = XHCI_COMMON(dev);
 
     if (xhci->numintrs > XHCI_MAXINTRS) {
         xhci->numintrs = XHCI_MAXINTRS;
@@ -3381,7 +3381,7 @@ static void usb_xhci_realize(DeviceState *dev, Error **errp)
 static void usb_xhci_unrealize(DeviceState *dev)
 {
     int i;
-    XHCIState *xhci = XHCI(dev);
+    XHCIState *xhci = XHCI_COMMON(dev);
 
     trace_usb_xhci_exit();
 
@@ -3591,7 +3591,7 @@ static void xhci_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo xhci_info = {
-    .name          = TYPE_XHCI,
+    .name          = TYPE_XHCI_COMMON,
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(XHCIState),
     .class_init    = xhci_class_init,
-- 
2.26.2



  parent reply	other threads:[~2020-11-07 11:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 11:13 [PATCH-for-5.2 0/5] hw/usb/hcd-xhci: Fix xhci-pci devices Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-5.2 1/5] hw/usb/hcd-xhci: Make xhci base model abstract Philippe Mathieu-Daudé
2020-11-08 13:38   ` Sai Pavan Boddu
2020-11-09  9:51   ` Gerd Hoffmann
2020-11-09 11:00     ` Philippe Mathieu-Daudé
2020-11-09 11:30       ` Gerd Hoffmann
2020-11-09 13:40         ` Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) Philippe Mathieu-Daudé
2020-11-08 13:40   ` Sai Pavan Boddu
2020-11-09 11:08   ` Gerd Hoffmann
2020-11-07 11:13 ` Philippe Mathieu-Daudé [this message]
2020-11-07 11:13 ` [PATCH-for-6.0 4/5] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro Philippe Mathieu-Daudé
2020-11-07 11:13 ` [PATCH-for-6.0 5/5] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON Philippe Mathieu-Daudé

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=20201107111307.262263-4-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sai.pavan.boddu@xilinx.com \
    /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).