[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/15] hw/riscv: sifive_u: Rename serial property get/set fun
From: |
Alistair Francis |
Subject: |
Re: [PATCH 10/15] hw/riscv: sifive_u: Rename serial property get/set functions to a generic name |
Date: |
Mon, 15 Jun 2020 09:39:26 -0700 |
On Mon, Jun 8, 2020 at 7:21 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Bin Meng <bin.meng@windriver.com>
>
> 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 <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
>
> hw/riscv/sifive_u.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> index ef51874..07e2ba0 100644
> --- a/hw/riscv/sifive_u.c
> +++ b/hw/riscv/sifive_u.c
> @@ -481,14 +481,16 @@ static void sifive_u_machine_set_start_in_flash(Object
> *obj, bool value, Error *
> s->start_in_flash = value;
> }
>
> -static void sifive_u_machine_get_serial(Object *obj, Visitor *v, const char
> *name,
> - void *opaque, Error **errp)
> +static void sifive_u_machine_get_uint32_prop(Object *obj, Visitor *v,
> + const char *name, void *opaque,
> + Error **errp)
> {
> visit_type_uint32(v, name, (uint32_t *)opaque, errp);
> }
>
> -static void sifive_u_machine_set_serial(Object *obj, Visitor *v, const char
> *name,
> - void *opaque, Error **errp)
> +static void sifive_u_machine_set_uint32_prop(Object *obj, Visitor *v,
> + const char *name, void *opaque,
> + Error **errp)
> {
> visit_type_uint32(v, name, (uint32_t *)opaque, errp);
> }
> @@ -507,8 +509,8 @@ static void sifive_u_machine_instance_init(Object *obj)
>
> s->serial = OTP_SERIAL;
> object_property_add(obj, "serial", "uint32",
> - sifive_u_machine_get_serial,
> - sifive_u_machine_set_serial, NULL, &s->serial);
> + sifive_u_machine_get_uint32_prop,
> + sifive_u_machine_set_uint32_prop, NULL, &s->serial);
> object_property_set_description(obj, "serial", "Board serial number");
> }
>
> --
> 2.7.4
>
>
- Re: [PATCH 08/15] hw/riscv: sifive_gpio: Do not blindly trigger output IRQs, (continued)
- [PATCH 05/15] hw/riscv: sifive_gpio: Clean up the codes, Bin Meng, 2020/06/08
- [PATCH 06/15] hw/riscv: sifive_gpio: Add a new 'ngpio' property, Bin Meng, 2020/06/08
- [PATCH 07/15] hw/riscv: sifive_u: Hook a GPIO controller, Bin Meng, 2020/06/08
- [PATCH 09/15] hw/riscv: sifive_u: Add reset functionality, Bin Meng, 2020/06/08
- [PATCH 10/15] hw/riscv: sifive_u: Rename serial property get/set functions to a generic name, Bin Meng, 2020/06/08
- Re: [PATCH 10/15] hw/riscv: sifive_u: Rename serial property get/set functions to a generic name,
Alistair Francis <=
- [PATCH 13/15] hw/riscv: sifive_u: Support different boot source per MSEL pin state, Bin Meng, 2020/06/08
- [PATCH 11/15] hw/riscv: sifive_u: Add a new property msel for MSEL pin state, Bin Meng, 2020/06/08
- [PATCH 12/15] hw/riscv: sifive: Change SiFive E/U CPU reset vector to 0x1004, Bin Meng, 2020/06/08
- [PATCH 14/15] hw/riscv: sifive_u: Sort the SoC memmap table entries, Bin Meng, 2020/06/08
- [PATCH 15/15] hw/riscv: sifive_u: Add a dummy DDR memory controller device, Bin Meng, 2020/06/08