diff mbox series

[05/21] hw/ppc/pnv_bmc: Use qdev_new() instead of QOM API

Message ID 20240216110313.17039-6-philmd@linaro.org
State Superseded
Headers show
Series hw: More QDev cleanups | expand

Commit Message

Philippe Mathieu-Daudé Feb. 16, 2024, 11:02 a.m. UTC
Prefer QDev API for QDev objects, avoid the underlying QOM layer.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/ppc/pnv_bmc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Cédric Le Goater Feb. 16, 2024, 11:08 a.m. UTC | #1
On 2/16/24 12:02, Philippe Mathieu-Daudé wrote:
> Prefer QDev API for QDev objects, avoid the underlying QOM layer.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.


> ---
>   hw/ppc/pnv_bmc.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
> index 99f1e8d7f9..0c1274df21 100644
> --- a/hw/ppc/pnv_bmc.c
> +++ b/hw/ppc/pnv_bmc.c
> @@ -269,13 +269,13 @@ void pnv_bmc_set_pnor(IPMIBmc *bmc, PnvPnor *pnor)
>    */
>   IPMIBmc *pnv_bmc_create(PnvPnor *pnor)
>   {
> -    Object *obj;
> +    DeviceState *dev;
>   
> -    obj = object_new(TYPE_IPMI_BMC_SIMULATOR);
> -    qdev_realize(DEVICE(obj), NULL, &error_fatal);
> -    pnv_bmc_set_pnor(IPMI_BMC(obj), pnor);
> +    dev = qdev_new(TYPE_IPMI_BMC_SIMULATOR);
> +    qdev_realize(dev, NULL, &error_fatal);
> +    pnv_bmc_set_pnor(IPMI_BMC(dev), pnor);
>   
> -    return IPMI_BMC(obj);
> +    return IPMI_BMC(dev);
>   }
>   
>   typedef struct ForeachArgs {
diff mbox series

Patch

diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
index 99f1e8d7f9..0c1274df21 100644
--- a/hw/ppc/pnv_bmc.c
+++ b/hw/ppc/pnv_bmc.c
@@ -269,13 +269,13 @@  void pnv_bmc_set_pnor(IPMIBmc *bmc, PnvPnor *pnor)
  */
 IPMIBmc *pnv_bmc_create(PnvPnor *pnor)
 {
-    Object *obj;
+    DeviceState *dev;
 
-    obj = object_new(TYPE_IPMI_BMC_SIMULATOR);
-    qdev_realize(DEVICE(obj), NULL, &error_fatal);
-    pnv_bmc_set_pnor(IPMI_BMC(obj), pnor);
+    dev = qdev_new(TYPE_IPMI_BMC_SIMULATOR);
+    qdev_realize(dev, NULL, &error_fatal);
+    pnv_bmc_set_pnor(IPMI_BMC(dev), pnor);
 
-    return IPMI_BMC(obj);
+    return IPMI_BMC(dev);
 }
 
 typedef struct ForeachArgs {