aboutsummaryrefslogtreecommitdiff
path: root/hw/audio
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-09-16 14:25:19 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-09-18 14:12:32 -0400
commit8063396bf3459a810d24e3efd6110b8480f0de5b (patch)
tree40f85f15d7016e3ee66916a59be53d2b2c71510a /hw/audio
parenta489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (diff)
Use OBJECT_DECLARE_SIMPLE_TYPE when possible
This converts existing DECLARE_INSTANCE_CHECKER usage to OBJECT_DECLARE_SIMPLE_TYPE when possible. $ ./scripts/codeconverter/converter.py -i \ --pattern=AddObjectDeclareSimpleType $(git grep -l '' -- '*.[ch]') Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Paul Durrant <paul@xen.org> Message-Id: <20200916182519.415636-6-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/audio')
-rw-r--r--hw/audio/ac97.c4
-rw-r--r--hw/audio/adlib.c4
-rw-r--r--hw/audio/es1370.c3
-rw-r--r--hw/audio/gus.c4
-rw-r--r--hw/audio/hda-codec.c3
-rw-r--r--hw/audio/intel-hda.h4
-rw-r--r--hw/audio/marvell_88w8618.c4
-rw-r--r--hw/audio/milkymist-ac97.c4
-rw-r--r--hw/audio/pcspk.c4
-rw-r--r--hw/audio/pl041.c4
-rw-r--r--hw/audio/sb16.c4
-rw-r--r--hw/audio/wm8750.c4
12 files changed, 12 insertions, 34 deletions
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index eb8a7f032d..3cb8131060 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -127,9 +127,7 @@ enum {
#define MUTE_SHIFT 15
#define TYPE_AC97 "AC97"
-typedef struct AC97LinkState AC97LinkState;
-DECLARE_INSTANCE_CHECKER(AC97LinkState, AC97,
- TYPE_AC97)
+OBJECT_DECLARE_SIMPLE_TYPE(AC97LinkState, AC97)
#define REC_MASK 7
enum {
diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c
index 870116e324..42d50d2fdc 100644
--- a/hw/audio/adlib.c
+++ b/hw/audio/adlib.c
@@ -52,9 +52,7 @@
#define SHIFT 1
#define TYPE_ADLIB "adlib"
-typedef struct AdlibState AdlibState;
-DECLARE_INSTANCE_CHECKER(AdlibState, ADLIB,
- TYPE_ADLIB)
+OBJECT_DECLARE_SIMPLE_TYPE(AdlibState, ADLIB)
struct AdlibState {
ISADevice parent_obj;
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index a824f8949e..6904589814 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -293,8 +293,7 @@ struct chan_bits {
};
#define TYPE_ES1370 "ES1370"
-DECLARE_INSTANCE_CHECKER(ES1370State, ES1370,
- TYPE_ES1370)
+OBJECT_DECLARE_SIMPLE_TYPE(ES1370State, ES1370)
static void es1370_dac1_calc_freq (ES1370State *s, uint32_t ctl,
uint32_t *old_freq, uint32_t *new_freq);
diff --git a/hw/audio/gus.c b/hw/audio/gus.c
index 307fd48315..e8719ee117 100644
--- a/hw/audio/gus.c
+++ b/hw/audio/gus.c
@@ -43,9 +43,7 @@
#endif
#define TYPE_GUS "gus"
-typedef struct GUSState GUSState;
-DECLARE_INSTANCE_CHECKER(GUSState, GUS,
- TYPE_GUS)
+OBJECT_DECLARE_SIMPLE_TYPE(GUSState, GUS)
struct GUSState {
ISADevice dev;
diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c
index 77d31b91a4..feb8f9e2bb 100644
--- a/hw/audio/hda-codec.c
+++ b/hw/audio/hda-codec.c
@@ -172,8 +172,7 @@ struct HDAAudioStream {
};
#define TYPE_HDA_AUDIO "hda-audio"
-DECLARE_INSTANCE_CHECKER(HDAAudioState, HDA_AUDIO,
- TYPE_HDA_AUDIO)
+OBJECT_DECLARE_SIMPLE_TYPE(HDAAudioState, HDA_AUDIO)
struct HDAAudioState {
HDACodecDevice hda;
diff --git a/hw/audio/intel-hda.h b/hw/audio/intel-hda.h
index e2372abbdc..f78c1833e3 100644
--- a/hw/audio/intel-hda.h
+++ b/hw/audio/intel-hda.h
@@ -12,9 +12,7 @@ OBJECT_DECLARE_TYPE(HDACodecDevice, HDACodecDeviceClass,
HDA_CODEC_DEVICE)
#define TYPE_HDA_BUS "HDA"
-typedef struct HDACodecBus HDACodecBus;
-DECLARE_INSTANCE_CHECKER(HDACodecBus, HDA_BUS,
- TYPE_HDA_BUS)
+OBJECT_DECLARE_SIMPLE_TYPE(HDACodecBus, HDA_BUS)
typedef void (*hda_codec_response_func)(HDACodecDevice *dev,
diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c
index c8641562cc..e6c09bdb8e 100644
--- a/hw/audio/marvell_88w8618.c
+++ b/hw/audio/marvell_88w8618.c
@@ -43,9 +43,7 @@
#define MP_AUDIO_CLOCK_24MHZ (1 << 9)
#define MP_AUDIO_MONO (1 << 14)
-typedef struct mv88w8618_audio_state mv88w8618_audio_state;
-DECLARE_INSTANCE_CHECKER(mv88w8618_audio_state, MV88W8618_AUDIO,
- TYPE_MV88W8618_AUDIO)
+OBJECT_DECLARE_SIMPLE_TYPE(mv88w8618_audio_state, MV88W8618_AUDIO)
struct mv88w8618_audio_state {
SysBusDevice parent_obj;
diff --git a/hw/audio/milkymist-ac97.c b/hw/audio/milkymist-ac97.c
index 7893539019..04b39f8345 100644
--- a/hw/audio/milkymist-ac97.c
+++ b/hw/audio/milkymist-ac97.c
@@ -56,9 +56,7 @@ enum {
};
#define TYPE_MILKYMIST_AC97 "milkymist-ac97"
-typedef struct MilkymistAC97State MilkymistAC97State;
-DECLARE_INSTANCE_CHECKER(MilkymistAC97State, MILKYMIST_AC97,
- TYPE_MILKYMIST_AC97)
+OBJECT_DECLARE_SIMPLE_TYPE(MilkymistAC97State, MILKYMIST_AC97)
struct MilkymistAC97State {
SysBusDevice parent_obj;
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index cbee8855fb..b056c05387 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -40,9 +40,7 @@
#define PCSPK_MAX_FREQ (PCSPK_SAMPLE_RATE >> 1)
#define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ)
-typedef struct PCSpkState PCSpkState;
-DECLARE_INSTANCE_CHECKER(PCSpkState, PC_SPEAKER,
- TYPE_PC_SPEAKER)
+OBJECT_DECLARE_SIMPLE_TYPE(PCSpkState, PC_SPEAKER)
struct PCSpkState {
ISADevice parent_obj;
diff --git a/hw/audio/pl041.c b/hw/audio/pl041.c
index 570a234b72..03acd4fe34 100644
--- a/hw/audio/pl041.c
+++ b/hw/audio/pl041.c
@@ -78,9 +78,7 @@ typedef struct {
} pl041_channel;
#define TYPE_PL041 "pl041"
-typedef struct PL041State PL041State;
-DECLARE_INSTANCE_CHECKER(PL041State, PL041,
- TYPE_PL041)
+OBJECT_DECLARE_SIMPLE_TYPE(PL041State, PL041)
struct PL041State {
SysBusDevice parent_obj;
diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 6aa2c0fb93..8b20700410 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -50,9 +50,7 @@
static const char e3[] = "COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992.";
#define TYPE_SB16 "sb16"
-typedef struct SB16State SB16State;
-DECLARE_INSTANCE_CHECKER(SB16State, SB16,
- TYPE_SB16)
+OBJECT_DECLARE_SIMPLE_TYPE(SB16State, SB16)
struct SB16State {
ISADevice parent_obj;
diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c
index 7d6fcfec03..b5722b37c3 100644
--- a/hw/audio/wm8750.c
+++ b/hw/audio/wm8750.c
@@ -27,9 +27,7 @@ typedef struct {
int dac_hz;
} WMRate;
-typedef struct WM8750State WM8750State;
-DECLARE_INSTANCE_CHECKER(WM8750State, WM8750,
- TYPE_WM8750)
+OBJECT_DECLARE_SIMPLE_TYPE(WM8750State, WM8750)
struct WM8750State {
I2CSlave parent_obj;