milkymist-memcard: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
880fc798fd
commit
7a239e46f7
@ -58,8 +58,13 @@ enum {
|
|||||||
R_MAX
|
R_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TYPE_MILKYMIST_MEMCARD "milkymist-memcard"
|
||||||
|
#define MILKYMIST_MEMCARD(obj) \
|
||||||
|
OBJECT_CHECK(MilkymistMemcardState, (obj), TYPE_MILKYMIST_MEMCARD)
|
||||||
|
|
||||||
struct MilkymistMemcardState {
|
struct MilkymistMemcardState {
|
||||||
SysBusDevice busdev;
|
SysBusDevice parent_obj;
|
||||||
|
|
||||||
MemoryRegion regs_region;
|
MemoryRegion regs_region;
|
||||||
SDState *card;
|
SDState *card;
|
||||||
|
|
||||||
@ -231,8 +236,7 @@ static const MemoryRegionOps memcard_mmio_ops = {
|
|||||||
|
|
||||||
static void milkymist_memcard_reset(DeviceState *d)
|
static void milkymist_memcard_reset(DeviceState *d)
|
||||||
{
|
{
|
||||||
MilkymistMemcardState *s =
|
MilkymistMemcardState *s = MILKYMIST_MEMCARD(d);
|
||||||
container_of(d, MilkymistMemcardState, busdev.qdev);
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
s->command_write_ptr = 0;
|
s->command_write_ptr = 0;
|
||||||
@ -246,7 +250,7 @@ static void milkymist_memcard_reset(DeviceState *d)
|
|||||||
|
|
||||||
static int milkymist_memcard_init(SysBusDevice *dev)
|
static int milkymist_memcard_init(SysBusDevice *dev)
|
||||||
{
|
{
|
||||||
MilkymistMemcardState *s = FROM_SYSBUS(typeof(*s), dev);
|
MilkymistMemcardState *s = MILKYMIST_MEMCARD(dev);
|
||||||
DriveInfo *dinfo;
|
DriveInfo *dinfo;
|
||||||
|
|
||||||
dinfo = drive_get_next(IF_SD);
|
dinfo = drive_get_next(IF_SD);
|
||||||
@ -289,7 +293,7 @@ static void milkymist_memcard_class_init(ObjectClass *klass, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo milkymist_memcard_info = {
|
static const TypeInfo milkymist_memcard_info = {
|
||||||
.name = "milkymist-memcard",
|
.name = TYPE_MILKYMIST_MEMCARD,
|
||||||
.parent = TYPE_SYS_BUS_DEVICE,
|
.parent = TYPE_SYS_BUS_DEVICE,
|
||||||
.instance_size = sizeof(MilkymistMemcardState),
|
.instance_size = sizeof(MilkymistMemcardState),
|
||||||
.class_init = milkymist_memcard_class_init,
|
.class_init = milkymist_memcard_class_init,
|
||||||
|
Loading…
Reference in New Issue
Block a user