* [Qemu-devel] [PATCH v2] ES1370: QOMify
@ 2016-02-01 7:57 Cao jin
2016-02-02 8:00 ` Michael Tokarev
0 siblings, 1 reply; 3+ messages in thread
From: Cao jin @ 2016-02-01 7:57 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, kraxel
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
v1 missed "pci_create_simple" modification.
hw/audio/es1370.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 592578b..f26fea3 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -288,6 +288,10 @@ struct chan_bits {
uint32_t *old_freq, uint32_t *new_freq);
};
+#define TYPE_ES1370 "ES1370"
+#define ES1370(obj) \
+ OBJECT_CHECK(ES1370State, (obj), TYPE_ES1370)
+
static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl,
uint32_t *old_freq, uint32_t *new_freq);
static void es1370_dac2_and_adc_calc_freq (ES1370State *s, uint32_t ctl,
@@ -1013,7 +1017,7 @@ static void es1370_on_reset (void *opaque)
static void es1370_realize(PCIDevice *dev, Error **errp)
{
- ES1370State *s = DO_UPCAST (ES1370State, dev, dev);
+ ES1370State *s = ES1370(dev);
uint8_t *c = s->dev.config;
c[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_SLOW >> 8;
@@ -1038,7 +1042,7 @@ static void es1370_realize(PCIDevice *dev, Error **errp)
static int es1370_init (PCIBus *bus)
{
- pci_create_simple (bus, -1, "ES1370");
+ pci_create_simple (bus, -1, TYPE_ES1370);
return 0;
}
@@ -1059,7 +1063,7 @@ static void es1370_class_init (ObjectClass *klass, void *data)
}
static const TypeInfo es1370_info = {
- .name = "ES1370",
+ .name = TYPE_ES1370,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof (ES1370State),
.class_init = es1370_class_init,
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] ES1370: QOMify
2016-02-01 7:57 [Qemu-devel] [PATCH v2] ES1370: QOMify Cao jin
@ 2016-02-02 8:00 ` Michael Tokarev
2016-02-02 8:03 ` Cao jin
0 siblings, 1 reply; 3+ messages in thread
From: Michael Tokarev @ 2016-02-02 8:00 UTC (permalink / raw)
To: Cao jin, qemu-devel; +Cc: qemu-trivial, kraxel
Sorry I replied to the wrong email. I actually applied this one :)
/mjt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH v2] ES1370: QOMify
2016-02-02 8:00 ` Michael Tokarev
@ 2016-02-02 8:03 ` Cao jin
0 siblings, 0 replies; 3+ messages in thread
From: Cao jin @ 2016-02-02 8:03 UTC (permalink / raw)
To: Michael Tokarev, qemu-devel; +Cc: qemu-trivial, kraxel
Thanks mjt:)
On 02/02/2016 04:00 PM, Michael Tokarev wrote:
> Sorry I replied to the wrong email. I actually applied this one :)
>
> /mjt
>
>
>
--
Yours Sincerely,
Cao jin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-02 8:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 7:57 [Qemu-devel] [PATCH v2] ES1370: QOMify Cao jin
2016-02-02 8:00 ` Michael Tokarev
2016-02-02 8:03 ` Cao jin
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.