From patchwork Tue Oct 17 13:50:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 734400 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp491742wro; Tue, 17 Oct 2023 06:51:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGneYUBFrkG8JI3/+Q5viuwKK2+tqh5TMulS0i22P52YxDdRZZwSC79QdJ3jock1xwF3uo0 X-Received: by 2002:a05:622a:2:b0:419:5be3:d577 with SMTP id x2-20020a05622a000200b004195be3d577mr2784027qtw.36.1697550694640; Tue, 17 Oct 2023 06:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697550694; cv=none; d=google.com; s=arc-20160816; b=JlgUTE7mavWiX02thkZXXnNfbD0G/L1MxqTBDKLClKa9SymPCC1Zxr7Drv+egAgRPA UfXEiHP8izSbyuwusFwmDr+xgZWc7qTnAp7qqE91yQgpA6fqIcgzvP3KPHJ5Zh7JIU52 E2r0rf5Q2SucHRGuU/QnYzWXHHKLMTCzuxZDp7W3OQ2w3Bca0CKVddo13nHwmEoeGfJA ApKsFMtiD8qIHH6/zLqxQDdixNtgAa0wHFsSKOdREEJUALpb+3ySntrdoSntNmE5m+OC LxLzmSN9z+/WY8xiLx8Yu8DOd80y8cWqg/efTsLHH141a+mwD1Q779hgVHx+UXb2vswM G7RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=x6BbhRUo6m3TQ2lMD7BvRrsDFT46E9vfn3DPv2BsTQc=; fh=zN1PZ4SkeLhxf1sfT8BFVakySwq5sy1Tqr1e2/1RGVo=; b=a/1B3/MW0PSZLxGHbrwRAaYofkl85FvnuN/PCGZ9fAnZSCMexJ7qBR2Ty6LoarGB0h 5Xz2+zO5MqyA7f9GpdObHAmiohGkE4vDvvW+lhvm7WS8Q57cYafxD830Wd3xEXVNEzGe dFX4JkAo/7TU3aHRDgzXjEtGYaq2gkXNF2WBZ3xpa4ceelU83Ery2ICOlVuIZQD0GBFm ilcFp1EiATWwp5Rv5KZzEpa2XSOfqeACSb1o+MYMHw9K6xe5FfbZpLTyFN4BG/fWU0yD IXmxtAdHvqGL/HfYX8afEJRwcyDgUnvq0LiSaYDJTjP9cRpa2/RUaoPNo6Sgpg68qAVI XyHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YggtuLYv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n18-20020ac85a12000000b004194bda92a6si1152779qta.97.2023.10.17.06.51.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Oct 2023 06:51:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YggtuLYv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qskTT-0008AS-7T; Tue, 17 Oct 2023 09:51:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qskTR-00086h-8b for qemu-devel@nongnu.org; Tue, 17 Oct 2023 09:51:05 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qskTP-00069L-N8 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 09:51:05 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9bda758748eso638228866b.2 for ; Tue, 17 Oct 2023 06:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697550662; x=1698155462; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x6BbhRUo6m3TQ2lMD7BvRrsDFT46E9vfn3DPv2BsTQc=; b=YggtuLYvaRgPLGFjzUHurwi01LXnnfP2P9xbEQJhnuUajkv3gokQ6NVKLLwcO5tjgp YjdR0IfY7nM8VEmEEj+OzbX3gvNJUToJ7bESIVFHgtNa7E05y6UImB/MIKvFMEO4nAiw eZPrLiIfh33RbbdBV5LFjHGqrnM6KKn8dD4625xsGMWMlKSLNeHV42Ufrnt9ewTpo3Mw m759L9uyx7KlOHOth0KdD9+fjj+inij1VzO4hT5Pj+RW8jR79z6FIwfGBNZ8KpEdaqg5 pby6tt4Fz6ftJ6bIAh6H++dCKvq2pSgvlNSMnx6pL4TSF7cs/ymwHUH0UxuE9D+79zC1 P5lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697550662; x=1698155462; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x6BbhRUo6m3TQ2lMD7BvRrsDFT46E9vfn3DPv2BsTQc=; b=p7+Gl7ZqxRy5SSR8eIDluI8RzUqY4IKxIO212bf9fDbvcvlZWOdXTUscA9SnsGszZd DNaEqOWFyT3V5Xsz3Yfpmi3REjvfRBcteQ1CGKwSRTij+J5DbBjNbaGcU50etCGiyEwz E7gD+auN7PC/n3xyD1FrQztCSUs9uFcO3BeIrfxWR8rbNfm455LBHPohCcG3aI8VXK1S 9mLsWF5jZbkbDdb5/HJbs+SnUU6UcSfIU51ZaIZK/d/A0jO3Q9ygLvp4sMRg3n9ysj4R q9IxyFyl5g1SbkGREG2IpF3prhpJ/ji34zDl2tyPan6BDS+28WoXjpnaM65q1hPmkrcl BSOA== X-Gm-Message-State: AOJu0Yw2h/S3p3cpXoOqYGWFv96lWXFhb5dk99p3NkmDw7S86RLnQujM ALul4DR2FOYpD8szBrlNzQ2cbtnUziIKBn5t5pw4JA== X-Received: by 2002:a17:907:3f1c:b0:9b8:8bcf:8732 with SMTP id hq28-20020a1709073f1c00b009b88bcf8732mr1912838ejc.43.1697550661887; Tue, 17 Oct 2023 06:51:01 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.33]) by smtp.gmail.com with ESMTPSA id jl6-20020a17090775c600b009b29553b648sm1271255ejc.206.2023.10.17.06.50.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 17 Oct 2023 06:51:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Marcel Apfelbaum , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , Eduardo Habkost , Bernhard Beschow , qemu-ppc@nongnu.org, Aleksandar Rikalo , Paolo Bonzini , Richard Henderson Subject: [PATCH] hw/audio/pcspk: Inline pcspk_init() Date: Tue, 17 Oct 2023 15:50:58 +0200 Message-ID: <20231017135058.44247-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=philmd@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org pcspk_init() is a legacy init function, inline and remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- 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/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h index 9506179587..6be75a6b86 100644 --- a/include/hw/audio/pcspk.h +++ b/include/hw/audio/pcspk.h @@ -25,16 +25,6 @@ #ifndef HW_PCSPK_H #define HW_PCSPK_H -#include "hw/isa/isa.h" -#include "hw/qdev-properties.h" -#include "qapi/error.h" - #define TYPE_PC_SPEAKER "isa-pcspk" -static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice *pit) -{ - object_property_set_link(OBJECT(isadev), "pit", OBJECT(pit), NULL); - isa_realize_and_unref(isadev, bus, &error_fatal); -} - #endif /* HW_PCSPK_H */ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index bb3854d1d0..3d0b53a583 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1283,7 +1283,8 @@ void pc_basic_device_init(struct PCMachineState *pcms, /* connect PIT to output control line of the HPET */ qdev_connect_gpio_out(hpet, 0, qdev_get_gpio_in(DEVICE(pit), 0)); } - pcspk_init(pcms->pcspk, isa_bus, pit); + object_property_set_link(OBJECT(pcms->pcspk), "pit", OBJECT(pit), NULL); + isa_realize_and_unref(pcms->pcspk, isa_bus, &error_fatal); } /* Super I/O */ diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 63e0857208..9474bf994c 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -67,6 +67,7 @@ static void i82378_realize(PCIDevice *pci, Error **errp) uint8_t *pci_conf; ISABus *isabus; ISADevice *pit; + ISADevice *pcspk; pci_conf = pci->config; pci_set_word(pci_conf + PCI_COMMAND, @@ -102,7 +103,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp) pit = i8254_pit_init(isabus, 0x40, 0, NULL); /* speaker */ - pcspk_init(isa_new(TYPE_PC_SPEAKER), isabus, pit); + pcspk = isa_new(TYPE_PC_SPEAKER); + object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), NULL); + isa_realize_and_unref(pcspk, isabus, &error_fatal); /* 2 82C37 (dma) */ isa_create_simple(isabus, "i82374"); 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) {