diff mbox series

[2/9] hw/ppc/sam460ex: Correctly set MAL properties

Message ID 20230203113650.78146-3-philmd@linaro.org
State Superseded
Headers show
Series hw: Use QOM alias properties and few QOM/QDev cleanups | expand

Commit Message

Philippe Mathieu-Daudé Feb. 3, 2023, 11:36 a.m. UTC
MAL properties are declared as uint8_t:

  static Property ppc4xx_mal_properties[] = {
      DEFINE_PROP_UINT8("txc-num", Ppc4xxMalState, txcnum, 0),
      DEFINE_PROP_UINT8("rxc-num", Ppc4xxMalState, rxcnum, 0),
      DEFINE_PROP_END_OF_LIST(),
  };

Set the property using qdev_prop_set_uint8().

Fixes: da116a8aab ("ppc/ppc405: QOM'ify MAL")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/sam460ex.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

BALATON Zoltan Feb. 3, 2023, 12:50 p.m. UTC | #1
On Fri, 3 Feb 2023, Philippe Mathieu-Daudé wrote:
> MAL properties are declared as uint8_t:
>
>  static Property ppc4xx_mal_properties[] = {
>      DEFINE_PROP_UINT8("txc-num", Ppc4xxMalState, txcnum, 0),
>      DEFINE_PROP_UINT8("rxc-num", Ppc4xxMalState, rxcnum, 0),
>      DEFINE_PROP_END_OF_LIST(),
>  };
>
> Set the property using qdev_prop_set_uint8().
>
> Fixes: da116a8aab ("ppc/ppc405: QOM'ify MAL")
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Apparently this makes no difference but MAL is also only there so the 
firmware can program it but does nothing otherwise.

Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>

> ---
> hw/ppc/sam460ex.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
> index 4a22ce3761..cf065aae0e 100644
> --- a/hw/ppc/sam460ex.c
> +++ b/hw/ppc/sam460ex.c
> @@ -389,8 +389,8 @@ static void sam460ex_init(MachineState *machine)
>
>     /* MAL */
>     dev = qdev_new(TYPE_PPC4xx_MAL);
> -    qdev_prop_set_uint32(dev, "txc-num", 4);
> -    qdev_prop_set_uint32(dev, "rxc-num", 16);
> +    qdev_prop_set_uint8(dev, "txc-num", 4);
> +    qdev_prop_set_uint8(dev, "rxc-num", 16);
>     ppc4xx_dcr_realize(PPC4xx_DCR_DEVICE(dev), cpu, &error_fatal);
>     object_unref(OBJECT(dev));
>     sbdev = SYS_BUS_DEVICE(dev);
>
diff mbox series

Patch

diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 4a22ce3761..cf065aae0e 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -389,8 +389,8 @@  static void sam460ex_init(MachineState *machine)
 
     /* MAL */
     dev = qdev_new(TYPE_PPC4xx_MAL);
-    qdev_prop_set_uint32(dev, "txc-num", 4);
-    qdev_prop_set_uint32(dev, "rxc-num", 16);
+    qdev_prop_set_uint8(dev, "txc-num", 4);
+    qdev_prop_set_uint8(dev, "rxc-num", 16);
     ppc4xx_dcr_realize(PPC4xx_DCR_DEVICE(dev), cpu, &error_fatal);
     object_unref(OBJECT(dev));
     sbdev = SYS_BUS_DEVICE(dev);