From patchwork Fri Oct 20 13:03:24 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: 736239 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp287883wrl; Fri, 20 Oct 2023 06:05:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBpDIFIyjVHnmc5NG0FpV4QgRPulb0E8sGQbbjbNNjiYzX4gFN1ejfrPqlEBduOfAnxdKt X-Received: by 2002:ac8:5d8c:0:b0:403:e3ce:565b with SMTP id d12-20020ac85d8c000000b00403e3ce565bmr1744435qtx.4.1697807113980; Fri, 20 Oct 2023 06:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697807113; cv=none; d=google.com; s=arc-20160816; b=PRMK1y/1KTipR4To7/aSrOvvuZuFXEI+mbCw3MBX+txUT5l9eO/dxrLixq9hgVHI64 otKPVDhD4RmTfo4IenzCx66wsi1ttL0wXCOtrSOseWeVhygvbj8HVeH9Lp76KQZR667L p9iLwUOSmCIJeMc1TP9iz3po8ygqoqFYfxD7c7L8IuUJDm0VvBNSKPGWyj1rEeZbSB/7 x7nT5nRNRknc7HQ0vri501kskT+jt4DyO8snTLL0T6mdS6NHYBoS0O4wuWPHt6siwalk +hYArcyVMT+bB1uFYHWhV5ZQn+APKUltXS3qbhYjW+exnQr+0xmAIZ4Jjcq7bUyKa5xp pNlw== 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=VvkfRXdPjwZ/XLZmVrV6N6IqteNQI6rI35LT6QBMgTk=; fh=QWGggua+3ufs1S3QlzhTWcDhlhc7bBCtXi/Y+/UuB8A=; b=HZyJzc0GVp07S+NvFPoEsEkUiRv+2KnK7rfMagBWe+GUZENAYISvSngRq+/2ROlKfs NOEK2iIGsBi55SmnOQc/uSPv6YS48mejo5KLeN499B7HR0cx76X+tCjqNU/180POuFx8 vxDb+j7qxaQgmvIC7hZCAQwhlh8dVQbPSxsQaqr/JVjGGpq0A40upNTjil6t84CAD1r1 J/TjqEUy/PLjlwBIUJEfUNJdeu7HzDfiyen+GVT+VaWwWbwoahKBxNakDQIjLMhZTE41 IBtqywoq60586xRhUwgvZkIe24t0B8449LFN8dOy++/2OjX6IbrJMBqfyIjSny+anaoi bADQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yDVvaO3D; 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 n20-20020a05622a11d400b0041cbb79ad47si1194894qtk.271.2023.10.20.06.05.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2023 06:05:13 -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=yDVvaO3D; 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 1qtpAs-0000uQ-4K; Fri, 20 Oct 2023 09:04:22 -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 1qtpAV-0000gr-Pv for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:04:05 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtpAP-0005Iw-MI for qemu-devel@nongnu.org; Fri, 20 Oct 2023 09:03:58 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9be02fcf268so120804766b.3 for ; Fri, 20 Oct 2023 06:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697807032; x=1698411832; 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=VvkfRXdPjwZ/XLZmVrV6N6IqteNQI6rI35LT6QBMgTk=; b=yDVvaO3DVY4OzZlGv3c9ePTIEw+jlkjRZBltkcoxAWrV3Lfl0jp9MYTk91cDFNww45 a/vOljD97KW3biVxE1EHabSBZspZEO0ZT/2CzOpOs9JgUJAjrXnnwNiZpGFo7oWwowvG IO6oi49jYb39w6KfFlRS2Rodlr573boO3f453PYz6gFINSdfzCsXXl0ZGT2X5EYennmS pl6sGRAKVvDA1hY9YlsgQ3c7Uczu4h1fI+DbbtrprVvYoEE8Srp0DXjA3bwj8GkxC8mA XPOCsTbDBM3CUZ6+WASRi7n7z5PVt5rm6W52HkGgZ7V2pPHDTcdmn4qJvW+gn2SyZ8Ur mnqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697807032; x=1698411832; 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=VvkfRXdPjwZ/XLZmVrV6N6IqteNQI6rI35LT6QBMgTk=; b=pE+7dGOQFIfiW3kimSDAM4t6y/yBbbMnSHM2gqcFEZeGcVZn4rzl/BYBCxSFkmDAyy 9sQjHLLOGZFQ8doZBcz2eYa86QIPDymK0dWSZwJRXP58d9fXUp+1PBAMUKroP3BOel56 yOHheO/SyN8lnLJs2rtWKymBJgzeJrW/XqIjKuGc1lV9j7qjni2HpOelV7EobrzyPcr8 I8ArldCkAXuSlxlKJ6OoHuAdRBSGjCNJ5QPk10YYvztP3VMyx9cCthPHzyGpdrDsQcLM IfA0OuUwlY/tuQ2WFgVuVdME9ifre0y8ja6mhvI6QC6syE9g2K85ctfs/VP9nx4uOzDP WS2A== X-Gm-Message-State: AOJu0YxazWkhPvkcjnPtyLvpDuWv6FAmTsAKA+rXYH3gCDjlU1tE94F0 V4z4e1b4cXd9sCtQdZNfcM4PvvjZbTMQrD5BVLE= X-Received: by 2002:a17:907:d19:b0:9b6:550c:71cb with SMTP id gn25-20020a1709070d1900b009b6550c71cbmr1132082ejc.52.1697807031911; Fri, 20 Oct 2023 06:03:51 -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 j12-20020a170906050c00b00977eec7b7e8sm1474283eja.68.2023.10.20.06.03.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 20 Oct 2023 06:03:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v3 3/9] hw/pcmcia/pxa2xx: Realize sysbus device before accessing it Date: Fri, 20 Oct 2023 15:03:24 +0200 Message-ID: <20231020130331.50048-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020130331.50048-1-philmd@linaro.org> References: <20231020130331.50048-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.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 sysbus_mmio_map() should not be called on unrealized device. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/pcmcia/pxa2xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/pcmcia/pxa2xx.c b/hw/pcmcia/pxa2xx.c index fcca7e571b..e7264feb45 100644 --- a/hw/pcmcia/pxa2xx.c +++ b/hw/pcmcia/pxa2xx.c @@ -142,15 +142,12 @@ PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem, hwaddr base) { DeviceState *dev; - PXA2xxPCMCIAState *s; dev = qdev_new(TYPE_PXA2XX_PCMCIA); - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - s = PXA2XX_PCMCIA(dev); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - return s; + return PXA2XX_PCMCIA(dev); } static void pxa2xx_pcmcia_initfn(Object *obj)