[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COM
From: |
Philippe Mathieu-Daudé |
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 |
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
[PATCH-for-5.2 2/5] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI), Philippe Mathieu-Daudé, 2020/11/07
[PATCH-for-6.0 3/5] hw/usb/hcd-xhci: Rename "base-xhci" as TYPE_XHCI_COMMON,
Philippe Mathieu-Daudé <=
[PATCH-for-6.0 4/5] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro, Philippe Mathieu-Daudé, 2020/11/07
[PATCH-for-6.0 5/5] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON, Philippe Mathieu-Daudé, 2020/11/07