Skip to content

Commit

Permalink
versal: use OBJECT_DECLARE_TYPE in LPD IOU SLCR
Browse files Browse the repository at this point in the history
Update the versal LPD IOU SLCR device model to use
OBJECT_DECLARE_SIMPLE_TYPE instead of the old OBJECT_CHECK.

Signed-off-by: Nelson Ho <[email protected]>
  • Loading branch information
ho28 committed Dec 10, 2024
1 parent b0bfc4d commit 55098f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hw/arm/xlnx-versal.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ static void versal_create_lpd_iou_slcr(Versal *s)
MemoryRegion *mr;

object_initialize_child(OBJECT(s), "lpd_iou_slcr", &s->lpd.iou.slcr,
TYPE_XLNX_LPD_IOU_SLCR);
TYPE_XILINX_LPD_IOU_SLCR);
sbd = SYS_BUS_DEVICE(&s->lpd.iou.slcr);
sysbus_realize(sbd, &error_fatal);

Expand Down
6 changes: 3 additions & 3 deletions hw/misc/xlnx-versal-lpd-iou-slcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ static void lpd_iou_slcr_init(Object *obj)
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
RegisterInfoArray *reg_array;

memory_region_init(&s->iomem, obj, TYPE_XLNX_LPD_IOU_SLCR, LPD_IOU_SLCR_R_MAX * 4);
memory_region_init(&s->iomem, obj, TYPE_XILINX_LPD_IOU_SLCR, LPD_IOU_SLCR_R_MAX * 4);
reg_array =
register_init_block32(DEVICE(obj), lpd_iou_slcr_regs_info,
ARRAY_SIZE(lpd_iou_slcr_regs_info),
Expand All @@ -702,7 +702,7 @@ static void lpd_iou_slcr_init(Object *obj)
}

static const VMStateDescription vmstate_lpd_iou_slcr = {
.name = TYPE_XLNX_LPD_IOU_SLCR,
.name = TYPE_XILINX_LPD_IOU_SLCR,
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
Expand All @@ -721,7 +721,7 @@ static void lpd_iou_slcr_class_init(ObjectClass *klass, void *data)
}

static const TypeInfo lpd_iou_slcr_info = {
.name = TYPE_XLNX_LPD_IOU_SLCR,
.name = TYPE_XILINX_LPD_IOU_SLCR,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(LPD_IOU_SLCR),
.class_init = lpd_iou_slcr_class_init,
Expand Down
7 changes: 2 additions & 5 deletions include/hw/misc/xlnx-versal-lpd-iou-slcr.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@

#include "qom/object.h"

#define TYPE_XLNX_LPD_IOU_SLCR "xlnx.versal-lpd-iou-slcr"
#define TYPE_XILINX_LPD_IOU_SLCR "xlnx.versal-lpd-iou-slcr"

OBJECT_DECLARE_SIMPLE_TYPE(LPD_IOU_SLCR, XLNX_LPD_IOU_SLCR)

#define XILINX_LPD_IOU_SLCR(obj) \
OBJECT_CHECK(LPD_IOU_SLCR, (obj), TYPE_XLNX_LPD_IOU_SLCR)
OBJECT_DECLARE_SIMPLE_TYPE(LPD_IOU_SLCR, XILINX_LPD_IOU_SLCR)

#define LPD_IOU_SLCR_R_MAX 459

Expand Down

0 comments on commit 55098f9

Please sign in to comment.