From patchwork Fri Oct 20 10:54:42 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: 736224 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp232052wrl; Fri, 20 Oct 2023 03:55:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFntcTzx3Z/ukxlE0dskMvJ64OAu+hPnRb+5rLjGXvoKhc379+0aaSWzqpv5zpgFgrMeffM X-Received: by 2002:a05:622a:110d:b0:419:5309:20fd with SMTP id e13-20020a05622a110d00b00419530920fdmr1868876qty.25.1697799333414; Fri, 20 Oct 2023 03:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799333; cv=none; d=google.com; s=arc-20160816; b=XgI6xSKKE5guLq7BmR1Kpd6mdYcEkJVaR/CmIf+YGgZBjxaY2X1mP2fq34dP3RDYMn Tmn1ZgiRv0h7WTF7s7ojaFfN+EAzXLOTH9QVybbJF5jiSC+9p5HHgYC2KvOJlrBrob+9 vvGdqDVK9I+XbySUQRcOoCy+UvtHZk2fDoVzPk83YvuyrDA6oJf8Adx08cDvWm7k45gi 4XG81qiN7TIAHklqKB2ab1meXwxyA08GyRUxK1j0tpAJ5vIPStA5hRIS+3OGi7psIZeI oJh4MULm5XUeHt1ANexOPYkLHlFkrzmsZsUaeN+tPP5SvnM4KqFHwYce5rLRMYQD9rqf 6bow== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hbJlLlLW1QaNDW3PSqCUmUPPQHDiEzU8rlIxTu4cfAA=; fh=+o9HV0Ll2NIzk6ga/FNoVIsPFoxvGZnJkelqukI4qDg=; b=K3o7wYxuYfPhaHP06oWdGCThP18oYF62O8qpXY9wma870To9IzyFH0j4Xaiqy6u9eg KxJIPYW49QrKgm7Dvd9nQOdq21cqgOFAyQJ2ezq/M0HBVhUTpnY/q2olZWV2eP/1oHMt kIo1At2/bHdxNX+p7+uZZcAPWZ1zEYxcfZBDq3UdFfEg5V96d8v/PQBcBB8RoM/pX9xr u/WlZhLOQ/hPOiqqWI2+vJqlmaBk79vwGHHz67lMOaZQQfAfC58P4j6zwkTDTbdYzuYf UFX643Cm//gLgBx0HQeVVu+Jy4ibVPtUP7PqlbHkb5oEGc2Pj5dYTAbEwPpDVYmLkjPn vrQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wp7Pzc0x; 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 g11-20020ac87d0b000000b00419ce76ad38si1070259qtb.76.2023.10.20.03.55.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 03:55:33 -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=Wp7Pzc0x; 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 1qtn9h-0006KS-Rd; Fri, 20 Oct 2023 06:55:01 -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 1qtn9g-0006Jq-7Y for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:00 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtn9d-00055E-Jk for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:54:59 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-307d58b3efbso467077f8f.0 for ; Fri, 20 Oct 2023 03:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799296; x=1698404096; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hbJlLlLW1QaNDW3PSqCUmUPPQHDiEzU8rlIxTu4cfAA=; b=Wp7Pzc0xuSyKAqIJx5QXkakteSYuC1ob2JnW6u6IYttPUMGbg81WGWu0Ta2Nn5VgYO IsKM0cYcaCH5NYZdJDa6QqR9CCRABjnh6R+pMg6G6LlFsdBH3TS4/jlmvDXrv72nDiaY L/G+/is3RG38AgsBtxsRae6ERLVgTWwiuYGmaQ6VhKyZ0SMAwkSdVczciWFFYBM3DDPG kjo8WMjhGfyDV7PPMZARsQFpIhNi5kmPVBZpTySzC6DFkVgC8PZ4St9Wlldnpi6urP6r IB2dYDrdNSCC/7Tl5W7rPRi6I34P3EzivmGnCBrMrcl8krA6/R0dEP8/yHDrP0/vKcQH KWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799296; x=1698404096; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hbJlLlLW1QaNDW3PSqCUmUPPQHDiEzU8rlIxTu4cfAA=; b=Vr3rW5aUvRVo3AE57BbjPRt69CL7v070pd6XdAG2UWarCk5LXU4CpXa2IuTk/8jBrc W01oag3vZuZOdXXDqT9vKEKy4/9U/bdJru53uwE+egIMy0TybO1/I5+XdneSvHUv5lV/ o5vyLXJbtL6+sB7Wlr0gyvPhwZ0UcjZePg0xeYQlVfn395lSam4fET2pABTVCo6AHuQ4 xI+pgu15N8XhxGRmJVIJBovDVIImQ9bbX6dRTZflobSu3jGa5cVfqlblIsqg9NHT4NjR 4JmJRhcS29FQZC830ZD70ny5K/TuEMurYegLjuJP/ZbzvtXFeobed0DyyAoZHtkOvyr2 M4Ag== X-Gm-Message-State: AOJu0YxHXZQ0l/92HcYNPD3m+AQLtRWIwNm6HxnXNIpRDR8IGqLaq4/y LoN6jMJgIyKzAdw4Ch6sA7npqiHjaGIF7T20efE= X-Received: by 2002:adf:fe02:0:b0:32d:8108:500 with SMTP id n2-20020adffe02000000b0032d81080500mr919974wrr.58.1697799296021; Fri, 20 Oct 2023 03:54:56 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id a3-20020a5d4d43000000b003196b1bb528sm1430438wru.64.2023.10.20.03.54.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 03:54:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Markus Armbruster , qemu-ppc@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v3 1/5] hw/i386/pc: Pass Error** argument to pc_basic_device_init() Date: Fri, 20 Oct 2023 12:54:42 +0200 Message-ID: <20231020105447.43482-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020105447.43482-1-philmd@linaro.org> References: <20231020105447.43482-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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 pc_basic_device_init() creates devices which can fail, allow to propagate error to caller. Suggested-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i386/pc.h | 5 +++-- hw/i386/pc.c | 7 +++++-- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index bec38cb92c..069c27368d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -174,11 +174,12 @@ void pc_memory_init(PCMachineState *pcms, uint64_t pci_hole64_size); uint64_t pc_pci_hole64_start(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); -void pc_basic_device_init(struct PCMachineState *pcms, +bool pc_basic_device_init(struct PCMachineState *pcms, ISABus *isa_bus, qemu_irq *gsi, ISADevice *rtc_state, bool create_fdctrl, - uint32_t hpet_irqs); + uint32_t hpet_irqs, + Error **errp); void pc_cmos_init(PCMachineState *pcms, BusState *ide0, BusState *ide1, ISADevice *s); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index bb3854d1d0..c0477f0141 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1189,11 +1189,12 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, g_free(a20_line); } -void pc_basic_device_init(struct PCMachineState *pcms, +bool pc_basic_device_init(struct PCMachineState *pcms, ISABus *isa_bus, qemu_irq *gsi, ISADevice *rtc_state, bool create_fdctrl, - uint32_t hpet_irqs) + uint32_t hpet_irqs, + Error **errp) { int i; DeviceState *hpet = NULL; @@ -1289,6 +1290,8 @@ void pc_basic_device_init(struct PCMachineState *pcms, /* Super I/O */ pc_superio_init(isa_bus, create_fdctrl, pcms->i8042_enabled, pcms->vmport != ON_OFF_AUTO_ON); + + return true; } void pc_nic_init(PCMachineClass *pcmc, ISABus *isa_bus, PCIBus *pci_bus) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e36a3262b2..0d9cdf773e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -320,7 +320,7 @@ static void pc_init1(MachineState *machine, /* init basic PC hardware */ pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, true, - 0x4); + 0x4, &error_fatal); pc_nic_init(pcmc, isa_bus, pci_bus); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a7386f2ca2..e4b05e3139 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -301,7 +301,7 @@ static void pc_q35_init(MachineState *machine) /* init basic PC hardware */ pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, !mc->no_floppy, - 0xff0104); + 0xff0104, &error_fatal); if (pcms->sata_enabled) { /* ahci and SATA device, for q35 1 ahci controller is built-in */ From patchwork Fri Oct 20 10:54:43 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: 736227 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp232248wrl; Fri, 20 Oct 2023 03:56:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGB2lXHkHk7LCHJk677i8Pf+2JMT7cKbaojbyxEQZS45wmLDCNAT2VaAV9xQvIyWMb90EdD X-Received: by 2002:a05:6214:19e2:b0:66d:9caf:c054 with SMTP id q2-20020a05621419e200b0066d9cafc054mr421180qvc.4.1697799375772; Fri, 20 Oct 2023 03:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799375; cv=none; d=google.com; s=arc-20160816; b=wnwe21dtHDkFmivSxZ+RoekC+vNyvkjBR6oLxI1dFFjcmnsWMAcW+eNdfOL2SXw9Gg RPNqkVClms+IQ/ZjqvFFAt7t51MiDOZOUyVqXmrHHxCebyxnAyzU4GrYtMvvEYzYg0sl btlBFjdvO7Blh2LfNmPUMLYT+p0QSpomz69mrvxZTHC2+16tRZ4lKUYKHDDpsK8Y8LJH OUxCI+GrlrhMfQjroCjC0dUCFx64RVZP0r1192FHxE0hs4XufZB02BfeLkp6bNJn9s5N dJQPd1DOYl/JySvlkflTiju7cWKYX2Dzvy1boc3qErMAgwzd0FMyFIQPUkVDRN2kfklf dBdA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jj0YHZoSu3dkacuU/y9YufW6rMNDzfwPVB4J+L/F+h4=; fh=+o9HV0Ll2NIzk6ga/FNoVIsPFoxvGZnJkelqukI4qDg=; b=jxmB3mLjt92SKVDpguf4HcN6kzL1wt9ZesStClh2uCfbD2BcLTkIO4lntaC8eU7w6g 4XFIsHvaRl1vcOTe0VsXK2+Jmp0bXuG9nbfyZmzV87/6Ao9TyRnZJgYhWN0U1X4E5xv2 U8lrrF9rOx7/5VfoXJJ2OHrIg++K4q8jPKeeXCHx+TWCTE9mvwm3uux1gTJEkh1pkXDP o1z+Mtqgl/59SB0Awh6dTBGmvw7dYAAcwIDx+JrPcTsZsdaSLvnnY2JKhj+/FNejFn2Q jG4wvsWrRwsdC9urUW8iRXMVKpIG748Q/UcoQ5yVTepTNiSmX2GAGsiieJFE5QNf+bET bFGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QtUtQN/G"; 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 bl7-20020a05620a1a8700b00774315b5ae1si1054284qkb.317.2023.10.20.03.56.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 03:56:15 -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="QtUtQN/G"; 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 1qtn9n-0006Mp-Cz; Fri, 20 Oct 2023 06:55:08 -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 1qtn9l-0006M9-EK for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:05 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtn9j-00057F-UD for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:05 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-406609df1a6so5266155e9.3 for ; Fri, 20 Oct 2023 03:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799302; x=1698404102; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jj0YHZoSu3dkacuU/y9YufW6rMNDzfwPVB4J+L/F+h4=; b=QtUtQN/GvfvoatgimD+m1jB2SjMBnNrqAgyJ1P85qZdxQxBpySUOUjx8gvZZDmD704 5hKvLs1hnDvMojhg4MOKWzqsIiErWRpL/TJKkhjLmz+xqPbPwxA+3miBk0Dz3Q25/fYP 9aB6kKs4AjM0f7D12R8A7gy90IGsRfg1MalFXaIHN2OzjTMLnjfr7P/8RwXrfov+iQoA 0nKNdDALudV1WGHmF+np+TVvsL9suaHsu9IxQzYZWAqH5IPPA+kS1vuwyjDB8wm1Hvpk 20M9VM4bnAsjCj0e3C91aoH53EoyVNzeWwXb2PExrAuqzfem5fexYuj8X0Zc4WqGK7d4 pHzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799302; x=1698404102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jj0YHZoSu3dkacuU/y9YufW6rMNDzfwPVB4J+L/F+h4=; b=MJNI6ZmgVgQPI+U/HFC+Ytpri8blvkLydd3VNrWdbLpwYpFji1E7IxEkV0omXFm8is F+jEJxqyp5t/Ed2G1+BVthKcSpyoJ2x6th1N7DVOxPoZLF9DE97aMsBDQKfPdvyJbkuw 5zSRXPOq4qvyTWlPwtXgkpSxK3yh5ilE1H8aKfa6xayw/xqlh9iV2v7KfH0D0/r6wCyS ZfsMUFVOV74qyHZu1zRgiHMfEPnrrdRHZHsYZIcQJ0kDkZXpmTN5x8XcCo/yTtSI9dC4 xwBnGdWBWWTaFM78fAxDKIER9dPuq/wOL0cU4Uwn2UNbsAva6NCc0MwsNz5CtAnFa+eb r4kw== X-Gm-Message-State: AOJu0YxPSyHkjueRvU1XN8vupQ+TqvaZwhgxrBJdbwFrDmO+mo9kHRPa voYKMZ57kqTaQdnzXeKhlp9dvQJxxgXfx72ZD30= X-Received: by 2002:a05:600c:45cb:b0:406:5359:769f with SMTP id s11-20020a05600c45cb00b004065359769fmr1202132wmo.0.1697799301988; Fri, 20 Oct 2023 03:55:01 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id l3-20020a5d5603000000b0032ddf2804ccsm1415684wrv.83.2023.10.20.03.55.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 03:55:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Markus Armbruster , qemu-ppc@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v3 2/5] hw/i386/pc: Propagate error if HPET device creation failed Date: Fri, 20 Oct 2023 12:54:43 +0200 Message-ID: <20231020105447.43482-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020105447.43482-1-philmd@linaro.org> References: <20231020105447.43482-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 Reported-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c0477f0141..c58a15182e 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1235,7 +1235,9 @@ bool pc_basic_device_init(struct PCMachineState *pcms, if (!compat) { qdev_prop_set_uint32(hpet, HPET_INTCAP, hpet_irqs); } - sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), &error_fatal); + if (!sysbus_realize_and_unref(SYS_BUS_DEVICE(hpet), errp)) { + return false; + } sysbus_mmio_map(SYS_BUS_DEVICE(hpet), 0, HPET_BASE); for (i = 0; i < IOAPIC_NUM_PINS; i++) { From patchwork Fri Oct 20 10:54:44 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: 736226 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp232149wrl; Fri, 20 Oct 2023 03:55:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtk7tvKuPqdWTXd0Js1ZTQ6SdwcJOJRlDrcwrPFYTCHJWrtZfdWo9ptmmmG4kVM47o0O17 X-Received: by 2002:a05:620a:394c:b0:76f:456:38fb with SMTP id qs12-20020a05620a394c00b0076f045638fbmr1449720qkn.31.1697799353344; Fri, 20 Oct 2023 03:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799353; cv=none; d=google.com; s=arc-20160816; b=rAbMBtaMw8QmhkfjnLLBLcV7fJYDZ4advDEhOCChsU3ZO9bJ0L4OEKJr3HX/BGCJUm ZtHAPlOaymaYjRqQLVq1UCz6ip9RiUvD93VNaUkr48Tz9SRb8diGge0JqGUCXx9ydK6X BBe4ExHlICsJtI7xUHORnyYGcQisKDAGOCzAJUQoikwiYRquB6TbK/vvEt4ZoEupMMts q8SSvCesxWJD3wMmlZcEFcSv7g+vT1OWpse4rjJ+wLVlFDYIm0/HgY2p9jfwSV2Ocsri MMhbmpWqmKSdrwO+6Bh1lI96V2BJNOvN8cqTUIKiKxZPq4cKhougI59/brZZi18S8lJZ zkIQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=maNUiJX2EIXBBVU6tPTB8OzF/SPwSGfPTsnOI6AFUoE=; fh=W6K7qkqhkLTCsYDgFribxHimDLhEVXbTltVOa+Pdw1s=; b=TfpcvRJZnrQvS2VQ0RnNG+JIXIjg4qg+nmtNdf0o0anABiDeaMeSSyS14tQemu054t Juoq8avAzoWIzWRCdMTZdPw8CYlyf1ltAPTTEtEZo47otDcCGeOWDSH7Ahbrn3FXRgGp nDZBZ8NEpc9r6CRmigfY9mziqgnuHvEsnoL3ymTg0ecR789FrrAB4QKoBDxyKeOfUrXq oqZj18KUndytYa7CjBy28Kf2mBTLw2avfp0KJLtcx2+whrNLViRO6UT8X8UDOGn9U29/ jl9H53wN88/6mg6ZfOhhCIaCBMf51nefynVAZxKaHbRqlQTUwGGTMANFZ/msNmL57B+N ZUbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BxuziZJi; 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 f7-20020a05620a12e700b00767e5d15d79si1103682qkl.34.2023.10.20.03.55.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 03:55:53 -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=BxuziZJi; 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 1qtnA9-0006Q0-9E; Fri, 20 Oct 2023 06:55:30 -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 1qtn9s-0006NQ-6W for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:12 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtn9q-0005Hs-7x for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:11 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40839652b97so5227025e9.3 for ; Fri, 20 Oct 2023 03:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799308; x=1698404108; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=maNUiJX2EIXBBVU6tPTB8OzF/SPwSGfPTsnOI6AFUoE=; b=BxuziZJiJAsqzzJ7sC7dSdsLTIGrWPK2smHvS0lCutmqk0Unuh/QcJmWi1S5H3k5i1 T9Ia/Ja6ctDEc0iQ45ID/9BYDIamVtMM55gVtWHClSnSsKRaKDX9KZor+j5VComuYiax uN8CHU5XIBeNjuUWSC7kgO1hTO4yFwzNlr/WG5f6EUWTnlzEh0qbkXaC5Y4hXqNa3leh yoPW4ipDVxiSDzBhxPxWOnWqmWCls9pAjAJ1RJbRF47nGByJaNxbY5iqqfyF+CK/h2mg lREtwBmYsm9aBJwYtTr1mNYWR44WFZEIDcgMXFmvXYC+Hommskk8PJ/Oj/J3YQ+p9QNi 1YWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799308; x=1698404108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=maNUiJX2EIXBBVU6tPTB8OzF/SPwSGfPTsnOI6AFUoE=; b=qA/NEhrSthckZ7YyO1A0Fq/Db/3HCWnGGl4h0yaTLxv4Svnu+igmDNK/oOEs63G1g9 5m93jxlu/p2HlmACWbbCpxlpdBzhV+12YZSlKbBG+U8g4b4nE0FfBztCURuFu52nYAMw BV33uk2oBreZM1nwwo/qivDGgE0zaUxVbY5Oakw/CSHN8ZY+e2s/DnJclQnMoNi1Ec5C AglKUcphVpazXm7lFOXHmSHKB23kW+Uq2sRlJOOxX4RnXMM5KWX+GLWx6fXFCekMlyYd jLTPIdmOJfcDQrHXvmYuq3DcEkkdVFVEh57AbxZqIGSv7UP4ulHAsV7yrsU6kh7q3oxt cpgg== X-Gm-Message-State: AOJu0YzGsRvoxnsuiwQ47tSXgOZVTOOwjfhP9Dog7rnH0tsa4Kf95dSV JfYZdh4f8kaGjM0KuBAkfWx/o7NoNQoQB8BXSbI= X-Received: by 2002:a05:600c:1992:b0:406:872d:7725 with SMTP id t18-20020a05600c199200b00406872d7725mr1223870wmq.1.1697799308184; Fri, 20 Oct 2023 03:55:08 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id k17-20020a5d66d1000000b00327cd5e5ac1sm1446378wrw.1.2023.10.20.03.55.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 03:55:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Markus Armbruster , qemu-ppc@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v3 3/5] hw/i386/pc: Inline legacy pcspk_init() in pc_basic_device_init() Date: Fri, 20 Oct 2023 12:54:44 +0200 Message-ID: <20231020105447.43482-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020105447.43482-1-philmd@linaro.org> References: <20231020105447.43482-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 Reviewed-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c58a15182e..3937d88355 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1286,7 +1286,11 @@ bool 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), &error_fatal); + if (!isa_realize_and_unref(pcms->pcspk, isa_bus, errp)) { + return false; + } } /* Super I/O */ From patchwork Fri Oct 20 10:54:45 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: 736225 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp232122wrl; Fri, 20 Oct 2023 03:55:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFn67OwfiA2U3DQS6OtYYIZXR8oLPCnUtFDnCiijq/5kgUY++JdjNN42GlFe6SZpQ37Kv+n X-Received: by 2002:a05:622a:1454:b0:417:b7c7:5a2b with SMTP id v20-20020a05622a145400b00417b7c75a2bmr1486141qtx.37.1697799347542; Fri, 20 Oct 2023 03:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799347; cv=none; d=google.com; s=arc-20160816; b=mmGaDkT2IoyfOxSRAgSz7Xm7Yhoq97inq9zCdcYfFZTHhU/MqDsAHjHxvJRqIZgL6C k4MTFdQ36Yg5I6Ka8pMr0bJ6q9bDgy1PBtVXr357XI8M2zUzwoY5sclZHzKTJq4AdDVD ybbQrcbNoPi6GP28C32riQLlRQ35sNfMZ+/HEZxy9PuXz2XHlvofoVLNln2ucbsb9sd1 KRhu5hex5n9IzMv8LZiu9yE9+qvr5C5fTp/svOYsX8w8HsFit95GkTHKkcirUJjCE1Bq J48EsG+Y6U27EPP0Uu5JijxDxYr+6unbH/4zArGBdpsq3RIGzj4U/FL6mDvzxPhqrTuo pqqA== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qWScBDjhmHe2mIRuU7IlnubQFDWtVdx50nOIOsC9Br8=; fh=wVexMczXz2VpHfCPB9ucS3FAODybm4LQNbqRTjnkbJM=; b=LWNucAhQK9vDjTGKgyKICfCraH8y4b1GIinv75uJ57wFyzVrQ1pIlov46TQIy5OZ6A kbgz9/jGHEyuAh+KhIfTvaor3PfEs6Vyiwx1V05oWs/T977wNtZJcHnSCDXymaWi4PQp hgBc2vMNnzxawYhexDaLBOo5qstSgdZ58ts9HI/UNxeGxYkLYaPwL0VZP3Tu0ZZFW+Mk DCywaa2ScCLxF/8GGQt5wKFYVCpsD5aablzMv7QRWFY/3+doDkNngCPyN2aJWIgGdjS4 Vh4nEljjzH3V7JSTRZT16OnGc1UbDKDY1Fa9T0KFTn4onznRuWfMnFPdWQT41szgfODu d34A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PvhVKT4R; 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 e12-20020ac85dcc000000b004195e83ec9esi1035906qtx.325.2023.10.20.03.55.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 03:55:47 -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=PvhVKT4R; 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 1qtnAK-0006hr-Rr; Fri, 20 Oct 2023 06:55:40 -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 1qtnA9-0006Rs-Kt for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:30 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtn9w-0005IX-1U for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:29 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4084095722aso5578335e9.1 for ; Fri, 20 Oct 2023 03:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799314; x=1698404114; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qWScBDjhmHe2mIRuU7IlnubQFDWtVdx50nOIOsC9Br8=; b=PvhVKT4R9ZlEcbhh+y7D3uPQdwy2b0Hr3MaGAUbAn+aWnuGb7+yo5iRrBHyTvloEyV 8S8bV6ooJIxdJ5m7EX+gOuvWgA8Mfu+W/L5hiQdpjqqyva4wuYF6nHhAiUhnhZsuDoVN 7X6Mo/9PqO8njxoQJCuhou3cHc3nNc0Ods4OgLRf4uIajg1o1Cba9t8T0fU50x23x2dX 34ONIz19Da9JYJ4NTE7QWEtzLF1sx9qvYkYz28/+M/+xpj727ysIbgri11Q0OMHK2dk+ erlCzylYN3ZaFTmCCEthOzVnX0vfK5jn2+CskWE4acpLyOY5ubrb/uMOIykCl+VBbKH3 wLiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799314; x=1698404114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qWScBDjhmHe2mIRuU7IlnubQFDWtVdx50nOIOsC9Br8=; b=fsX+Ju0KK1ztyTwnF3Kr51gmRGcxlcmXf8bRes16ay4SPlowd2/ylImFBOxRsZMZSR T1uBgMyY7UjFtziOJQHoAYZInOuEPeBK+gwo/glCN5vcIGgpWAe2xE3Tx5BHoAnJj8Ue 46uyPoyNgYCSVCZNaXDFdm98u0M4ccKTHXOh8NTLWGtFgECyDArO/vVeH13KIbL2PeUr KKRaW+j3JGnOEueEh/aXnKwD+dNqWBbrugAlqIVswWZ2mf4QmBR2szbYilFI1i/SKVN0 dVswOuFZG088qOtSk2tGqDpvmUFsq8O2OSAVV4wZnUe+1WnzVqh4S2gu6MXoq0kevN52 hv3g== X-Gm-Message-State: AOJu0YywLiLRJVkM+eqphVfd16//DDK5Tj26C1cFNc0ag87aA07snnKR 27TxCBKazySZ1kbggdEehLJr3K7+q9REO6oX7DA= X-Received: by 2002:a05:600c:a44:b0:407:5185:192b with SMTP id c4-20020a05600c0a4400b004075185192bmr1136572wmq.36.1697799313939; Fri, 20 Oct 2023 03:55:13 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id fa10-20020a05600c518a00b004064741f855sm1833486wmb.47.2023.10.20.03.55.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 03:55:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Markus Armbruster , qemu-ppc@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= Subject: [PATCH v3 4/5] hw/isa/i82378: Inline legacy pcspk_init() Date: Fri, 20 Oct 2023 12:54:45 +0200 Message-ID: <20231020105447.43482-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020105447.43482-1-philmd@linaro.org> References: <20231020105447.43482-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=ham 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 Reviewed-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/i82378.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 63e0857208..203b92c264 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,11 @@ 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), &error_fatal); + if (!isa_realize_and_unref(pcspk, isabus, errp)) { + return; + } /* 2 82C37 (dma) */ isa_create_simple(isabus, "i82374"); From patchwork Fri Oct 20 10:54:46 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: 736228 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp232336wrl; Fri, 20 Oct 2023 03:56:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoz+QJ1wzc5k5m+F7C7eg21bVFBUYxe2FNxeu723+ToSUlvVJZlZuyu3wPezrjX6vsYGGs X-Received: by 2002:a05:6214:23c9:b0:66d:2064:c7ee with SMTP id hr9-20020a05621423c900b0066d2064c7eemr1737465qvb.20.1697799392751; Fri, 20 Oct 2023 03:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799392; cv=none; d=google.com; s=arc-20160816; b=Ns+GxHe1IgIrY41T6ZDJwP8F3rpFZfraXWIKSFrZMnrdQMnr28dXHPlJT+ux56dB/G R/Pm97antUeUFioEeMeu9MlvMpruKiSc73tzt4d2Xy81nkFrZ7Cn9BWcqiYuyjtcF8LY RdnbGfVoBJca39xfSTfBIGGShZXoTCN8zw2ZeGWnMlDRZRQS2bbhbgI6xH3+ONFeG762 virtdsNuepTmDbyuD/gK4xRc4XddA6vVKW/pemeS6jaSO77vM+BnLN1Yin00knW1gwsM iGL/CPtYQrPdnh79rHEKQqn3K+n2Tqa5TmlqVnX4l2CnC8kPiQjQMFwZVphiOnygjTBn Jb1Q== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WlikVhR9pm9KIliEUk0Cuop74S2gqM0uH/MGQp63tm4=; fh=2b0qr2R80OGNaFw+FUec0z8iDvQyz4+PLzXBDQWZ5uQ=; b=B40PMbk6D9eCNWMfmoSOvu89vof9os5PDINYVnJcdLq159ywcsIVvXuyRL719WRAu3 1PaQO3ZtuBKqiSDd3E5FXff/xX7Am5eEUm6C1ZTyKKv3icZx+2aTBeKUiOgNfQiVEEH3 PcSZc+nXXvEZ6iroCLqS7k75XeEC28Joytt61CwQtXzguRtviy7v6opoWVFUsFfRZZ1D H6o1okHLP5ujJuZVStI9duCi6qQoUXux+5W57IS5kvDRpHz4ZzEfFGLbD7x0pM4CIc8O q3jdqwXF13UzQ6i3NjTN62ynnSpZ9/RmRSCqEXtD9XKKv1NpJQyZ++TUjhvNRqtkIrIv DCmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FtPgTjij; 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 i7-20020a05620a404700b00775d0d3bed1si1108970qko.658.2023.10.20.03.56.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 03:56:32 -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=FtPgTjij; 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 1qtnAI-0006Zi-23; Fri, 20 Oct 2023 06:55:38 -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 1qtnAA-0006SG-Ro for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:33 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtnA2-0005KZ-4t for qemu-devel@nongnu.org; Fri, 20 Oct 2023 06:55:30 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-31fa15f4cc6so483776f8f.2 for ; Fri, 20 Oct 2023 03:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799320; x=1698404120; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WlikVhR9pm9KIliEUk0Cuop74S2gqM0uH/MGQp63tm4=; b=FtPgTjijBRfyLhqK9MA1yCgZSwNSBRjtcErE6LCxH/phcPMuwiUt3yRJFTzxXDkxIy lNa+lu2qN/Cqj1qhp8bQ4YfpHv78zjLLFhoy4+ljWlP5zVzeLjVQ64x95u1Wzw/xVLw4 dxySL53XZdKd+sQEQlDFif7mrW8R3vRZ2tfoJmfo9HIq4Dp2+z+WJQb0fLIygVbzDJyf qPzHEnb7C6FLPi6LcZX+XdmOskczEzX6r2el5X4J049O2zbCRkwiG9bAshAQJXFb3aQE S/6yWHCJlW5sA1C+SVHfqShf6axI1XpjfOA+9W6OZyY2bHxgxpDe3Vk/llB1l8ZJgSid 7A5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799320; x=1698404120; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WlikVhR9pm9KIliEUk0Cuop74S2gqM0uH/MGQp63tm4=; b=tZh5ME4h0dfCMwTnM9v4BtQf0p01uab9LqCtdlXKSAfW94PdiEpAyzsNxTmbNa3NBg ou21mcqgN+MzD19TQySHk53TYZwPDaCidmPCThG0a3FWH8fHyCOPgKNKDuvDe2cMj62+ NWebqyQZLmhNC6qnoo2FhVW0+9sFEV91AHDA6Tu+hCasmntrLgGatHTXtbNfANXzIU79 iPO7VvJF8t2CLuEDB/ygVFacXhAqPpnk1p6wZyVpnoWOckwF77ahmj13e5FT4g3w1SOK DTlv1qFTfKATlzlWPlsXwTrVArMrLdlV/1c9yiaz1pDW/ssjNrdmOPaV9x02JeSSRLVc NyCA== X-Gm-Message-State: AOJu0Yw0AHE4pZP1wre/lmYVXOYxHWggzgvzosJ7w6ljTz643qm5Ot5j YlKAUhjAi6apFs3ajxnn1qmLShwPQngGuW2A9s0= X-Received: by 2002:adf:e590:0:b0:32d:8357:42dd with SMTP id l16-20020adfe590000000b0032d835742ddmr1043121wrm.68.1697799319888; Fri, 20 Oct 2023 03:55:19 -0700 (PDT) Received: from m1x-phil.lan (tbo33-h01-176-171-212-97.dsl.sta.abo.bbox.fr. [176.171.212.97]) by smtp.gmail.com with ESMTPSA id h2-20020a5d5042000000b0032d886039easm1444297wrt.14.2023.10.20.03.55.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 03:55:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , Markus Armbruster , qemu-ppc@nongnu.org, =?utf-8?q?Phili?= =?utf-8?q?ppe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= , Aleksandar Rikalo , Gerd Hoffmann , Jiaxun Yang Subject: [PATCH v3 5/5] hw/mips/jazz: Inline and remove legacy pcspk_init() Date: Fri, 20 Oct 2023 12:54:46 +0200 Message-ID: <20231020105447.43482-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020105447.43482-1-philmd@linaro.org> References: <20231020105447.43482-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=ham 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. Reviewed-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé --- include/hw/audio/pcspk.h | 10 ---------- hw/mips/jazz.c | 5 ++++- 2 files changed, 4 insertions(+), 11 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/mips/jazz.c b/hw/mips/jazz.c index c32d2b0b0a..cdc37126c2 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), &error_fatal); + isa_realize_and_unref(pcspk, isa_bus, &error_fatal); /* Video card */ switch (jazz_model) {