summaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-28 18:01:36 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-18 15:14:37 +0200
commit3cb75a7cba7e808c0ae007e4d86750849642304e (patch)
treea4e645a38566e0540d9654fa33e61ac1106968a8 /hw/usb
parent2f262e06f01a38cb8a218b7c5ad71233883a6b55 (diff)
downloadqemu-3cb75a7cba7e808c0ae007e4d86750849642304e.tar.gz
qdev: Move bus properties to a separate global
Simple code movement in order to simplify future refactoring. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/bus.c15
-rw-r--r--hw/usb/dev-smartcard-reader.c10
2 files changed, 15 insertions, 10 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 2068640a58..3faf4cb2ee 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -11,19 +11,22 @@ static char *usb_get_dev_path(DeviceState *dev);
static char *usb_get_fw_dev_path(DeviceState *qdev);
static int usb_qdev_exit(DeviceState *qdev);
+static Property usb_props[] = {
+ DEFINE_PROP_STRING("port", USBDevice, port_path),
+ DEFINE_PROP_BIT("full-path", USBDevice, flags,
+ USB_DEV_FLAG_FULL_PATH, true),
+ DEFINE_PROP_END_OF_LIST()
+};
+
static struct BusInfo usb_bus_info = {
.name = "USB",
.size = sizeof(USBBus),
.print_dev = usb_bus_dev_print,
.get_dev_path = usb_get_dev_path,
.get_fw_dev_path = usb_get_fw_dev_path,
- .props = (Property[]) {
- DEFINE_PROP_STRING("port", USBDevice, port_path),
- DEFINE_PROP_BIT("full-path", USBDevice, flags,
- USB_DEV_FLAG_FULL_PATH, true),
- DEFINE_PROP_END_OF_LIST()
- },
+ .props = usb_props,
};
+
static int next_usb_bus = 0;
static QTAILQ_HEAD(, USBBus) busses = QTAILQ_HEAD_INITIALIZER(busses);
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 3b7604e8b1..357b7e8a3e 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -1055,13 +1055,15 @@ static Answer *ccid_peek_next_answer(USBCCIDState *s)
: &s->pending_answers[s->pending_answers_start % PENDING_ANSWERS_NUM];
}
+static Property ccid_props[] = {
+ DEFINE_PROP_UINT32("slot", struct CCIDCardState, slot, 0),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static struct BusInfo ccid_bus_info = {
.name = "ccid-bus",
.size = sizeof(CCIDBus),
- .props = (Property[]) {
- DEFINE_PROP_UINT32("slot", struct CCIDCardState, slot, 0),
- DEFINE_PROP_END_OF_LIST(),
- }
+ .props = ccid_props,
};
void ccid_card_send_apdu_to_guest(CCIDCardState *card,