From patchwork Wed Feb 15 16:16:37 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: 653729 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp432669wrr; Wed, 15 Feb 2023 08:21:09 -0800 (PST) X-Google-Smtp-Source: AK7set9wFBYMt2oPRZylG23OEXsbsMwfe8R270IlTH9C+vpT0Wi/fLb0NV5bM9yrgsb04ug0VSPl X-Received: by 2002:a05:622a:46:b0:3b8:57a7:7836 with SMTP id y6-20020a05622a004600b003b857a77836mr4364168qtw.46.1676478069529; Wed, 15 Feb 2023 08:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676478069; cv=none; d=google.com; s=arc-20160816; b=BOEv0h395R+mFztrKlAns7EGqvkDV2tzmfsI+hFaavj2n+nFdxX2+nuCrNSdNugvhd jRvlbq5OAJSdjlilzqnIi7tDNTYL1sE7bkvZM8MdSCB0bg+vAZL2zTFVcrSSqUaciDUE 1r9yTB4TQiYYWb1ErBU8ttNNaKtprr51pVCH4UKlfW2wKfsg+puv6kkHDy7WiEl99xyq v5M+Js1Edfloglf+cUJvOa8edC7ojcpYV4GI6yJ2XgsBiG32LKpUOhRU2SKQ2WcTzQYX FOIU7QHH3BTa+cmUwOyOe0yeBhzs4rhXiqm0ninEURLshi4B1i3gRJyTephUiN+bk4fd dRRg== 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=N56SCywPfrFBIywCm7hp89GbcF0PG+s+C1TwdwIEIvI=; b=I1NqLa0o6CZO3A6UmRafFgBFZMvz17unH6lsoZpuUwsXKXzHRnJjwnLukmC0bl2jIu ygRMMpSRpfIgyUeIBFHbB4xsC/fulsZ4rEBOX9R6OxHMx11ROrUSGv0IqHXtnBoYUeSp HoNIo6EBjpPxzCBasVP5MLDlVQqCFai66nRgDlKm6ktSCQv25TF+IovGmPIdLmhvAtLQ P8bkOqnGwXSHxdTOa+qDEVL6bso7BMd9FjGXATsQFrmKlkFwt39v/oo8VDd1D4L8Ptav 4umSNHKrVyO9CXsPW3jT0vfp4jQCsUXCNcmaI1p1cN+lo6t++xvrwJ56aaqqRRvx7ARy 7qQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZWfBMaGK; 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 n127-20020a37bd85000000b0072b562a287dsi13445919qkf.514.2023.02.15.08.21.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 08:21:09 -0800 (PST) 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=ZWfBMaGK; 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 1pSKUZ-0000nf-AT; Wed, 15 Feb 2023 11:18:47 -0500 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 1pSKTr-0008Pe-Nx for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:04 -0500 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 1pSKTp-0008RW-N5 for qemu-devel@nongnu.org; Wed, 15 Feb 2023 11:18:03 -0500 Received: by mail-wm1-x330.google.com with SMTP id r18so13714007wmq.5 for ; Wed, 15 Feb 2023 08:18:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=N56SCywPfrFBIywCm7hp89GbcF0PG+s+C1TwdwIEIvI=; b=ZWfBMaGKpRyCT6OmPutkN7J+5/NIURI+kkldQUfJqa62WBAP9dVOuAwbsT1tPASD+z 7c4pExa5OzJLWoV94ysr0SBoaTT1qDp/RRzPxJ5s9zph80iybfYnTRFfkVVE9Gz9REIa HjHyVhWD8ezjAZI81Kl3tIKNxz1LkpkOxw4PiSi7Ezt2nZuOnRqXnxwBqnBHQPgY3+kI +dXRTUkEAFoMPYZoRSbM9PvSyX0/Q7eHcQkLeqBuL7mKNcF2LiED4PAQILsODOR5i96y +1oozRHjmbe52wxR6RyROXwiCiYPUdq3y176vetRRNKBpuSTtd+gPiXhZcwBZo9tZW/1 3LeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=N56SCywPfrFBIywCm7hp89GbcF0PG+s+C1TwdwIEIvI=; b=d7XEB8ef+9C9uiyyLUCF5D/C8JetOhnQGguueRZjS0cq7/gjrIRiFSaHYE3kZIEE0+ uACt05UR1Valy90zDKvC46rZ3ml2ZAnS75X3RaxiXLq6UsSrv3FAc9o42/eCkPgREQT4 i5F2grM4ZHysOknpaLzJFQ5Ado1ubGQHud9HjputQjfMIy/NjL2rS1ry/7zWbqYjh4N7 0cD2KzZgj2gYBvwjUhgMBAL81KHvyAVtHtQ8GvF/m/Lnr2z9VBkdyBvKn5iVdjikJgTt WoaK8tddRoIyY6feMmAHBF6lH9XCtHi2UlcyeSkZIQmlOYZkYcO1fYTgqTOtTpt0xhhh WEnA== X-Gm-Message-State: AO0yUKWAG7gVESV3REN2RvYhD79kWFOcygHDzIdQMPJjvFgdjCqXBpmS avVp3b+UtfGS0q6vveAphJi97q2rTK2ptilj X-Received: by 2002:a05:600c:1819:b0:3e0:10d:f1c with SMTP id n25-20020a05600c181900b003e0010d0f1cmr2392096wmp.37.1676477879933; Wed, 15 Feb 2023 08:17:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t14-20020a1c770e000000b003dfdeb57027sm2379319wmi.38.2023.02.15.08.17.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 08:17:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , qemu-block@nongnu.org, John Snow , Eduardo Habkost , Paolo Bonzini , Kevin Wolf , qemu-ppc@nongnu.org, Hanna Reitz , "Michael S. Tsirkin" , Richard Henderson , Gerd Hoffmann , Bernhard Beschow Subject: [PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport() Date: Wed, 15 Feb 2023 17:16:37 +0100 Message-Id: <20230215161641.32663-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230215161641.32663-1-philmd@linaro.org> References: <20230215161641.32663-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 TYPE_PIIX3_IDE is a PCI function inheriting from QOM TYPE_PCI_DEVICE. To be able to call the ISA specific ide_init_ioport_isa(), we call this function passing a NULL ISADevice argument. Remove this hack by calling the recently added generic ide_init_ioport(), which doesn't expect any ISADevice. Inspired-by: Bernhard Beschow Signed-off-by: Philippe Mathieu-Daudé --- hw/ide/piix.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index 9b886fc0d2..74e2f4288d 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -138,7 +138,6 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) {0x1f0, 0x3f6}, {0x170, 0x376}, }; - int ret; if (!d->irq[i]) { error_setg(errp, "output IDE IRQ %u not connected", i); @@ -146,13 +145,9 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i, Error **errp) } ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2); - ret = ide_bus_init_ioport_isa(&d->bus[i], NULL, - port_info[i].iobase, port_info[i].iobase2); - if (ret) { - error_setg_errno(errp, -ret, "Failed to realize %s port %u", - object_get_typename(OBJECT(d)), i); - return false; - } + ide_bus_init_ioport(&d->bus[i], OBJECT(d), + pci_address_space_io(PCI_DEVICE(d)), + port_info[i].iobase, port_info[i].iobase2); ide_bus_init_output_irq(&d->bus[i], d->irq[i]); bmdma_init(&d->bus[i], &d->bmdma[i], d);