qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/audio/pcspk: Inline pcspk_init()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/audio/pcspk: Inline pcspk_init()
Date: Wed, 18 Oct 2023 07:02:00 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

On 17/10/23 22:08, Mark Cave-Ayland wrote:
On 17/10/2023 14:50, Philippe Mathieu-Daudé wrote:

pcspk_init() is a legacy init function, inline and remove it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  include/hw/audio/pcspk.h | 10 ----------
  hw/i386/pc.c             |  3 ++-
  hw/isa/i82378.c          |  5 ++++-
  hw/mips/jazz.c           |  5 ++++-
  4 files changed, 10 insertions(+), 13 deletions(-)


diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index c32d2b0b0a..aac851747c 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -177,6 +177,7 @@ static void mips_jazz_init(MachineState *machine,
      SysBusDevice *sysbus;
      ISABus *isa_bus;
      ISADevice *pit;
+    ISADevice *pcspk;
      DriveInfo *fds[MAX_FD];
      MemoryRegion *bios = g_new(MemoryRegion, 1);
      MemoryRegion *bios2 = g_new(MemoryRegion, 1);
@@ -279,7 +280,9 @@ static void mips_jazz_init(MachineState *machine,
      isa_bus_register_input_irqs(isa_bus, i8259);
      i8257_dma_init(isa_bus, 0);
      pit = i8254_pit_init(isa_bus, 0x40, 0, NULL);
-    pcspk_init(isa_new(TYPE_PC_SPEAKER), isa_bus, pit);
+    pcspk = isa_new(TYPE_PC_SPEAKER);
+    object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), NULL);
+    isa_realize_and_unref(pcspk, isa_bus, &error_fatal);
      /* Video card */
      switch (jazz_model) {

Possibly you might want to pass errp instead of NULL for the last parameter of object_property_set_link() in i82378_realize()?

Oops you are right. I'll use &error_fatal.

But regardless:

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]