From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
qemu-trivial@nongnu.org,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Beniamino Galvani" <b.galvani@gmail.com>,
"Niek Linnenbank" <nieklinnenbank@gmail.com>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
"David Gibson" <david@gibson.dropbear.id.au>
Subject: [PATCH 1/2] hw/arm: Use TYPE_SYSBUS_OHCI instead of hardcoded string
Date: Fri, 3 Jul 2020 20:49:51 +0200 [thread overview]
Message-ID: <20200703184952.4918-2-f4bug@amsat.org> (raw)
In-Reply-To: <20200703184952.4918-1-f4bug@amsat.org>
By using the TYPE_* definitions for devices, we can:
- quickly find where devices are used with 'git-grep'
- easily rename a non-user-creatable device (one-line change).
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/arm/allwinner-h3.c | 9 +++++----
hw/arm/pxa2xx.c | 3 ++-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/arm/allwinner-h3.c b/hw/arm/allwinner-h3.c
index 8e09468e86..231d9ad647 100644
--- a/hw/arm/allwinner-h3.c
+++ b/hw/arm/allwinner-h3.c
@@ -28,6 +28,7 @@
#include "hw/sysbus.h"
#include "hw/char/serial.h"
#include "hw/misc/unimp.h"
+#include "hw/usb/hcd-ohci.h"
#include "hw/usb/hcd-ehci.h"
#include "hw/loader.h"
#include "sysemu/sysemu.h"
@@ -381,16 +382,16 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
qdev_get_gpio_in(DEVICE(&s->gic),
AW_H3_GIC_SPI_EHCI3));
- sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI0],
+ sysbus_create_simple(TYPE_SYSBUS_OHCI, s->memmap[AW_H3_OHCI0],
qdev_get_gpio_in(DEVICE(&s->gic),
AW_H3_GIC_SPI_OHCI0));
- sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI1],
+ sysbus_create_simple(TYPE_SYSBUS_OHCI, s->memmap[AW_H3_OHCI1],
qdev_get_gpio_in(DEVICE(&s->gic),
AW_H3_GIC_SPI_OHCI1));
- sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI2],
+ sysbus_create_simple(TYPE_SYSBUS_OHCI, s->memmap[AW_H3_OHCI2],
qdev_get_gpio_in(DEVICE(&s->gic),
AW_H3_GIC_SPI_OHCI2));
- sysbus_create_simple("sysbus-ohci", s->memmap[AW_H3_OHCI3],
+ sysbus_create_simple(TYPE_SYSBUS_OHCI, s->memmap[AW_H3_OHCI3],
qdev_get_gpio_in(DEVICE(&s->gic),
AW_H3_GIC_SPI_OHCI3));
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index f104a33463..1e8a1cbc24 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -22,6 +22,7 @@
#include "hw/irq.h"
#include "hw/qdev-properties.h"
#include "hw/ssi/ssi.h"
+#include "hw/usb/hcd-ohci.h"
#include "chardev/char-fe.h"
#include "sysemu/blockdev.h"
#include "sysemu/qtest.h"
@@ -2196,7 +2197,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
s->ssp[i] = (SSIBus *)qdev_get_child_bus(dev, "ssi");
}
- sysbus_create_simple("sysbus-ohci", 0x4c000000,
+ sysbus_create_simple(TYPE_SYSBUS_OHCI, 0x4c000000,
qdev_get_gpio_in(s->pic, PXA2XX_PIC_USBH1));
s->pcmcia[0] = pxa2xx_pcmcia_init(address_space, 0x20000000);
--
2.21.3
next prev parent reply other threads:[~2020-07-03 18:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 18:49 [PATCH 0/2] hw: Use TYPE_SYSBUS_OHCI instead of hardcoded string Philippe Mathieu-Daudé
2020-07-03 18:49 ` Philippe Mathieu-Daudé [this message]
2020-07-03 21:29 ` [PATCH 1/2] hw/arm: " Niek Linnenbank
2020-07-03 18:49 ` [PATCH 2/2] hw/ppc: " Philippe Mathieu-Daudé
2020-07-03 19:58 ` BALATON Zoltan
2020-07-03 21:57 ` Philippe Mathieu-Daudé
2020-07-05 5:34 ` David Gibson
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=20200703184952.4918-2-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=b.galvani@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=nieklinnenbank@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.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 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).