[PATCH 4/4] hw/arm/smmuv3: Consolidate the use of device_class_set_parent_realize()

Zhao Liu posted 4 patches 9 months, 4 weeks ago
Maintainers: Eric Auger <eric.auger@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, David Hildenbrand <david@redhat.com>, "Hervé Poussineau" <hpoussin@reactos.org>, BALATON Zoltan <balaton@eik.bme.hu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>
[PATCH 4/4] hw/arm/smmuv3: Consolidate the use of device_class_set_parent_realize()
Posted by Zhao Liu 9 months, 4 weeks ago
From: Zhao Liu <zhao1.liu@intel.com>

Use device_class_set_parent_realize() to set parent realize() directly.

Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
---
 hw/arm/smmuv3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 68eeef3e1d4c..b3d8642a4990 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1857,8 +1857,8 @@ static void smmuv3_class_init(ObjectClass *klass, void *data)
     dc->vmsd = &vmstate_smmuv3;
     resettable_class_set_parent_phases(rc, NULL, smmu_reset_hold, NULL,
                                        &c->parent_phases);
-    c->parent_realize = dc->realize;
-    dc->realize = smmu_realize;
+    device_class_set_parent_realize(dc, smmu_realize,
+                                    &c->parent_realize);
     device_class_set_props(dc, smmuv3_properties);
 }
 
-- 
2.34.1
Re: [PATCH 4/4] hw/arm/smmuv3: Consolidate the use of device_class_set_parent_realize()
Posted by Thomas Huth 9 months, 4 weeks ago
On 01/02/2024 09.40, Zhao Liu wrote:
> From: Zhao Liu <zhao1.liu@intel.com>
> 
> Use device_class_set_parent_realize() to set parent realize() directly.
> 
> Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
> ---
>   hw/arm/smmuv3.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 68eeef3e1d4c..b3d8642a4990 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1857,8 +1857,8 @@ static void smmuv3_class_init(ObjectClass *klass, void *data)
>       dc->vmsd = &vmstate_smmuv3;
>       resettable_class_set_parent_phases(rc, NULL, smmu_reset_hold, NULL,
>                                          &c->parent_phases);
> -    c->parent_realize = dc->realize;
> -    dc->realize = smmu_realize;
> +    device_class_set_parent_realize(dc, smmu_realize,
> +                                    &c->parent_realize);
>       device_class_set_props(dc, smmuv3_properties);
>   }
>   

Reviewed-by: Thomas Huth <thuth@redhat.com>