mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
musicpal: QOM cast cleanup for mv88w8618_flashcfg
Introduce a type constant, use QOM casts and rename the parent field. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
4adc8541d9
commit
5952b01cf8
1 changed files with 11 additions and 4 deletions
|
@ -982,8 +982,15 @@ static const TypeInfo mv88w8618_pit_info = {
|
||||||
/* Flash config register offsets */
|
/* Flash config register offsets */
|
||||||
#define MP_FLASHCFG_CFGR0 0x04
|
#define MP_FLASHCFG_CFGR0 0x04
|
||||||
|
|
||||||
|
#define TYPE_MV88W8618_FLASHCFG "mv88w8618_flashcfg"
|
||||||
|
#define MV88W8618_FLASHCFG(obj) \
|
||||||
|
OBJECT_CHECK(mv88w8618_flashcfg_state, (obj), TYPE_MV88W8618_FLASHCFG)
|
||||||
|
|
||||||
typedef struct mv88w8618_flashcfg_state {
|
typedef struct mv88w8618_flashcfg_state {
|
||||||
SysBusDevice busdev;
|
/*< private >*/
|
||||||
|
SysBusDevice parent_obj;
|
||||||
|
/*< public >*/
|
||||||
|
|
||||||
MemoryRegion iomem;
|
MemoryRegion iomem;
|
||||||
uint32_t cfgr0;
|
uint32_t cfgr0;
|
||||||
} mv88w8618_flashcfg_state;
|
} mv88w8618_flashcfg_state;
|
||||||
|
@ -1023,7 +1030,7 @@ static const MemoryRegionOps mv88w8618_flashcfg_ops = {
|
||||||
|
|
||||||
static int mv88w8618_flashcfg_init(SysBusDevice *dev)
|
static int mv88w8618_flashcfg_init(SysBusDevice *dev)
|
||||||
{
|
{
|
||||||
mv88w8618_flashcfg_state *s = FROM_SYSBUS(mv88w8618_flashcfg_state, dev);
|
mv88w8618_flashcfg_state *s = MV88W8618_FLASHCFG(dev);
|
||||||
|
|
||||||
s->cfgr0 = 0xfffe4285; /* Default as set by U-Boot for 8 MB flash */
|
s->cfgr0 = 0xfffe4285; /* Default as set by U-Boot for 8 MB flash */
|
||||||
memory_region_init_io(&s->iomem, OBJECT(s), &mv88w8618_flashcfg_ops, s,
|
memory_region_init_io(&s->iomem, OBJECT(s), &mv88w8618_flashcfg_ops, s,
|
||||||
|
@ -1053,7 +1060,7 @@ static void mv88w8618_flashcfg_class_init(ObjectClass *klass, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo mv88w8618_flashcfg_info = {
|
static const TypeInfo mv88w8618_flashcfg_info = {
|
||||||
.name = "mv88w8618_flashcfg",
|
.name = TYPE_MV88W8618_FLASHCFG,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(mv88w8618_flashcfg_state),
|
.instance_size = sizeof(mv88w8618_flashcfg_state),
|
||||||
.class_init = mv88w8618_flashcfg_class_init,
|
.class_init = mv88w8618_flashcfg_class_init,
|
||||||
|
@ -1651,7 +1658,7 @@ static void musicpal_init(QEMUMachineInitArgs *args)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
sysbus_create_simple("mv88w8618_flashcfg", MP_FLASHCFG_BASE, NULL);
|
sysbus_create_simple(TYPE_MV88W8618_FLASHCFG, MP_FLASHCFG_BASE, NULL);
|
||||||
|
|
||||||
qemu_check_nic_model(&nd_table[0], "mv88w8618");
|
qemu_check_nic_model(&nd_table[0], "mv88w8618");
|
||||||
dev = qdev_create(NULL, TYPE_MV88W8618_ETH);
|
dev = qdev_create(NULL, TYPE_MV88W8618_ETH);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue