diff mbox series

[7/9] hw/net: Have eTSEC device inherit from DYNAMIC_SYS_BUS_DEVICE

Message ID 20250125181343.59151-8-philmd@linaro.org (mailing list archive)
State New
Headers show
Series hw/sysbus/platform-bus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE | expand

Commit Message

Philippe Mathieu-Daudé Jan. 25, 2025, 6:13 p.m. UTC
Because the network eTSEC device can be optionally plugged on the
TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/net/fsl_etsec/etsec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Richard Henderson Jan. 26, 2025, 9:54 p.m. UTC | #1
On 1/25/25 10:13, Philippe Mathieu-Daudé wrote:
> Because the network eTSEC device can be optionally plugged on the
> TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/net/fsl_etsec/etsec.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
CLEMENT MATHIEU--DRIF Jan. 27, 2025, 6:21 a.m. UTC | #2
Reviewed-by: Clément Mathieu--Drif<clement.mathieu--drif@eviden.com>



On 25/01/2025 19:13, Philippe Mathieu-Daudé wrote:
> Caution: External email. Do not open attachments or click links, unless this email comes from a known sender and you know the content is safe.
>
>
> Because the network eTSEC device can be optionally plugged on the
> TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/net/fsl_etsec/etsec.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
> index 781b9003954..3ce4fa2662d 100644
> --- a/hw/net/fsl_etsec/etsec.c
> +++ b/hw/net/fsl_etsec/etsec.c
> @@ -425,14 +425,12 @@ static void etsec_class_init(ObjectClass *klass, void *data)
>       dc->realize = etsec_realize;
>       device_class_set_legacy_reset(dc, etsec_reset);
>       device_class_set_props(dc, etsec_properties);
> -    /* Supported by ppce500 machine */
> -    dc->user_creatable = true;
>   }
>
>   static const TypeInfo etsec_types[] = {
>       {
>           .name          = TYPE_ETSEC_COMMON,
> -        .parent        = TYPE_SYS_BUS_DEVICE,
> +        .parent        = TYPE_DYNAMIC_SYS_BUS_DEVICE,
>           .instance_size = sizeof(eTSEC),
>           .class_init    = etsec_class_init,
>           .instance_init = etsec_instance_init,
> --
> 2.47.1
>
Bernhard Beschow Jan. 27, 2025, 9:21 a.m. UTC | #3
Am 25. Januar 2025 18:13:41 UTC schrieb "Philippe Mathieu-Daudé" <philmd@linaro.org>:
>Because the network eTSEC device can be optionally plugged on the
>TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE.
>
>Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Tested-by: Bernhard Beschow <shentey@gmail.com>
Acked-by: Bernhard Beschow <shentey@gmail.com>

>---
> hw/net/fsl_etsec/etsec.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
>diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
>index 781b9003954..3ce4fa2662d 100644
>--- a/hw/net/fsl_etsec/etsec.c
>+++ b/hw/net/fsl_etsec/etsec.c
>@@ -425,14 +425,12 @@ static void etsec_class_init(ObjectClass *klass, void *data)
>     dc->realize = etsec_realize;
>     device_class_set_legacy_reset(dc, etsec_reset);
>     device_class_set_props(dc, etsec_properties);
>-    /* Supported by ppce500 machine */
>-    dc->user_creatable = true;
> }
> 
> static const TypeInfo etsec_types[] = {
>     {
>         .name          = TYPE_ETSEC_COMMON,
>-        .parent        = TYPE_SYS_BUS_DEVICE,
>+        .parent        = TYPE_DYNAMIC_SYS_BUS_DEVICE,
>         .instance_size = sizeof(eTSEC),
>         .class_init    = etsec_class_init,
>         .instance_init = etsec_instance_init,
diff mbox series

Patch

diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index 781b9003954..3ce4fa2662d 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -425,14 +425,12 @@  static void etsec_class_init(ObjectClass *klass, void *data)
     dc->realize = etsec_realize;
     device_class_set_legacy_reset(dc, etsec_reset);
     device_class_set_props(dc, etsec_properties);
-    /* Supported by ppce500 machine */
-    dc->user_creatable = true;
 }
 
 static const TypeInfo etsec_types[] = {
     {
         .name          = TYPE_ETSEC_COMMON,
-        .parent        = TYPE_SYS_BUS_DEVICE,
+        .parent        = TYPE_DYNAMIC_SYS_BUS_DEVICE,
         .instance_size = sizeof(eTSEC),
         .class_init    = etsec_class_init,
         .instance_init = etsec_instance_init,