Skip to content

Commit 3e9667c

Browse files
lbmengalistair23
authored andcommitted
hw/riscv: sifive_u: Rename serial property get/set functions to a generic name
In prepration to add more properties to this machine, rename the existing serial property get/set functions to a generic name. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Alistair Francis <[email protected]> Message-id: [email protected] Message-Id: <[email protected]> Signed-off-by: Alistair Francis <[email protected]>
1 parent 5133ed1 commit 3e9667c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

hw/riscv/sifive_u.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,16 @@ static void sifive_u_machine_set_start_in_flash(Object *obj, bool value, Error *
478478
s->start_in_flash = value;
479479
}
480480

481-
static void sifive_u_machine_get_serial(Object *obj, Visitor *v, const char *name,
482-
void *opaque, Error **errp)
481+
static void sifive_u_machine_get_uint32_prop(Object *obj, Visitor *v,
482+
const char *name, void *opaque,
483+
Error **errp)
483484
{
484485
visit_type_uint32(v, name, (uint32_t *)opaque, errp);
485486
}
486487

487-
static void sifive_u_machine_set_serial(Object *obj, Visitor *v, const char *name,
488-
void *opaque, Error **errp)
488+
static void sifive_u_machine_set_uint32_prop(Object *obj, Visitor *v,
489+
const char *name, void *opaque,
490+
Error **errp)
489491
{
490492
visit_type_uint32(v, name, (uint32_t *)opaque, errp);
491493
}
@@ -504,8 +506,8 @@ static void sifive_u_machine_instance_init(Object *obj)
504506

505507
s->serial = OTP_SERIAL;
506508
object_property_add(obj, "serial", "uint32",
507-
sifive_u_machine_get_serial,
508-
sifive_u_machine_set_serial, NULL, &s->serial);
509+
sifive_u_machine_get_uint32_prop,
510+
sifive_u_machine_set_uint32_prop, NULL, &s->serial);
509511
object_property_set_description(obj, "serial", "Board serial number");
510512
}
511513

0 commit comments

Comments
 (0)