summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCao jin <caoj.fnst@cn.fujitsu.com>2016-02-01 15:57:35 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2016-02-11 15:15:46 +0300
commit0d769044d669223fb973c7e8739522fc2bc185fb (patch)
treec0c776749a9830952ef52a25b4050af65bb912aa /hw
parent0850d49cb6b808a334528ea9a239f8bdb0d5efca (diff)
downloadqemu-0d769044d669223fb973c7e8739522fc2bc185fb.tar.gz
qemu-0d769044d669223fb973c7e8739522fc2bc185fb.tar.bz2
qemu-0d769044d669223fb973c7e8739522fc2bc185fb.zip
ES1370: QOMify
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw')
-rw-r--r--hw/audio/es1370.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 96acbc6e2f..8449b5f436 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -289,6 +289,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,
@@ -1014,7 +1018,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;
@@ -1039,7 +1043,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;
}
@@ -1060,7 +1064,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,