From patchwork Mon Jan 9 12:08:26 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: 640630 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2104475pvb; Mon, 9 Jan 2023 04:28:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXsukSalZASIswGNDBioz00K5yNvFnfUC1Qbm/u4bFZAj5+lgb68+kWuFEt441KZ8UPzAagI X-Received: by 2002:a05:6214:2c20:b0:51f:6fd9:e5a with SMTP id lc32-20020a0562142c2000b0051f6fd90e5amr90515386qvb.39.1673267333354; Mon, 09 Jan 2023 04:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267333; cv=none; d=google.com; s=arc-20160816; b=TwrQ2bhat7pInOxU6pO43LIerKoQdR9WtYt5+8icAU7VVDmsOWZ9q8urKDfajLqaDx ZJ0xsuQ/R/p7wgt5okhsAcd6smmuGOmJKdvIvw6tOXiOh+kZPsyDjZ1PJyz60sOMM6Xw 5hPLGAH9FeFRQMvrnoxTPj2mneclsL9pTEs8jmkXSrUw23qDruy+EsU5lS3GLA4K/o4I odm0TUi4leqeS0GzlZOD2tokbyusPgzwbw230LMPIuRusb4lR4VMgEmIDkfiz4njo0ZQ JPkQCOMb1NuGky1vFPgHVJ3CoLNQ4owwDFYNP+G8/917WvYD4fY+rCk/3VWYmPC4f6SA VutQ== 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=6AR2ZUwcAh0vmjYEOu0eNTVNMoV0yrhbxAqfFJUy1vo=; b=rv+VT1fbjgPP9arw130/25TNfylCK31h/1cOjerXf93uoK08B+30Kpl2tzDP1GWz8S ZcE7WPfFUVSUg50LVeGSWzlGnA8+Idxx/gnSEBKUT05h2z9NcA/wQAYEY27AioDBG6xr JQ3dPpdBE+ELfdSobZ6D0KBZEmyuq2JjLExcIm/CqcWmRqDVge/m2iOXtAtQ95m2oHgb 8xP+DHCwb1s3G5G6DJ6VckMpKmFRpeyUbwy6TffErV6MzbCLeJsy8ACWECR+8vNo2QZW 33QyteROLXyJAL2tElXNpcDl2nCLq8pIXlxqFfXNA+kgx4HrIs8D2qQu9RLa0Yp456nh eswA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=px3MEXgV; 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 j3-20020a05620a410300b006fefb4b755csi4415534qko.6.2023.01.09.04.28.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:28:53 -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=px3MEXgV; 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 1pEqyI-0000Hp-Lx; Mon, 09 Jan 2023 07:09:46 -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 1pEqyG-0000Gv-Pj for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:09:44 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqyF-0006FV-4t for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:09:44 -0500 Received: by mail-wr1-x431.google.com with SMTP id m7so7920743wrn.10 for ; Mon, 09 Jan 2023 04:09:42 -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=6AR2ZUwcAh0vmjYEOu0eNTVNMoV0yrhbxAqfFJUy1vo=; b=px3MEXgValMVaRZ/dR0QBv3hiWqXhFErKyPpV+/Y62pefAwG02tZfLyC41YNykXSKI P9YHUxjE6iBqlVNHN3zrK69l34MDwxHsv5vSjiWq+K/VrxlxOVzzeEBrq/wYWEEMbiNT oyLfM2wbn9KPzaK5Eb0Eag4qhSR7c6PhtWh41iWjb+avIXNGezde+zgSsFyn4aJ1O/si olCzVHYaocX06vgwvYd9xbCv0Z+/LjTPIte6xhLWnZYIM5JISZuOVwQ4fImoxuHIRXxX 7gFZi0HKS5VtN/GNysN/qXyaIFtSeRCbIQMUxiX60LCf0JSwOIAEb3besMJwBeJX1DGW qLAA== 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=6AR2ZUwcAh0vmjYEOu0eNTVNMoV0yrhbxAqfFJUy1vo=; b=ulILAjXGpMLmn2vGAFf6CuwpFhR5mA1ZnUQMcMa+ABJPo64OEBpv8soUJW6qUyFRdJ J4tT9Wb2zyUkn1eeQrwT0JFrmSezj1EKrzTXpHq/ptp3rDgTd30LwqyffPQ0CcnSALAj oZX3ZfK15wx//K3cs2MsnbXdtE8k3j0ZhaN4SUQbt0tSVgyCri9D9FxLHG6nwOPZmVKd QrE3GAZotGnYivDqpQG7SCHJRTfaKtuRtAPA1/JH/Ad+pCouqS8P9UkVmo3eOXnsElop 1tnzjsNiW5waiFwWpXr91fxXWFHxwNTI8jEHle/jLgXOuU2ihk5+eBsWuXw5Ks0VlVhs FMxA== X-Gm-Message-State: AFqh2koHgC7ePcMv0YoxqmAlJ6ZMsivIXDholSVsAifhI/K0pivJB8Kt f0GVSVzF2jVqox5H4uVDQeN8ce8NpqWcQq1j X-Received: by 2002:adf:f107:0:b0:284:5050:5e59 with SMTP id r7-20020adff107000000b0028450505e59mr29079963wro.29.1673266181579; Mon, 09 Jan 2023 04:09:41 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bj7-20020a0560001e0700b002b6667d3adfsm8426733wrb.80.2023.01.09.04.09.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:09:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bin Meng Subject: [PATCH v2 14/21] hw/block: Remove unused pflash_cfi02_register() Date: Mon, 9 Jan 2023 13:08:26 +0100 Message-Id: <20230109120833.3330-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109120833.3330-1-philmd@linaro.org> References: <20230109120833.3330-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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 We converted all caller of pflash_cfi02_register() by open coding a call to pflash_cfi02_create() followed by an explicit call to sysbus_mmio_map(); we can now remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bin Meng --- hw/block/pflash_cfi02.c | 36 ------------------------------------ include/hw/block/flash.h | 13 ------------- 2 files changed, 49 deletions(-) diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index 55ddd0916c..6168e66d7e 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -993,39 +993,3 @@ static void pflash_cfi02_register_types(void) } type_init(pflash_cfi02_register_types) - -PFlashCFI02 *pflash_cfi02_register(hwaddr base, - const char *name, - hwaddr size, - BlockBackend *blk, - uint32_t sector_len, - int nb_mappings, int width, - uint16_t id0, uint16_t id1, - uint16_t id2, uint16_t id3, - uint16_t unlock_addr0, - uint16_t unlock_addr1, - int be) -{ - DeviceState *dev = qdev_new(TYPE_PFLASH_CFI02); - - if (blk) { - qdev_prop_set_drive(dev, "drive", blk); - } - assert(QEMU_IS_ALIGNED(size, sector_len)); - qdev_prop_set_uint32(dev, "num-blocks", size / sector_len); - qdev_prop_set_uint32(dev, "sector-length", sector_len); - qdev_prop_set_uint8(dev, "device-width", width); - qdev_prop_set_uint8(dev, "mappings", nb_mappings); - qdev_prop_set_uint8(dev, "big-endian", !!be); - qdev_prop_set_uint16(dev, "id0", id0); - qdev_prop_set_uint16(dev, "id1", id1); - qdev_prop_set_uint16(dev, "id2", id2); - qdev_prop_set_uint16(dev, "id3", id3); - qdev_prop_set_uint16(dev, "unlock-addr0", unlock_addr0); - qdev_prop_set_uint16(dev, "unlock-addr1", unlock_addr1); - qdev_prop_set_string(dev, "name", name); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - - sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); - return PFLASH_CFI02(dev); -} diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index 25affdf7a5..d615bf6a53 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -31,19 +31,6 @@ void pflash_cfi01_legacy_drive(DeviceState *dev, DriveInfo *dinfo); OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI02, PFLASH_CFI02) -PFlashCFI02 *pflash_cfi02_register(hwaddr base, - const char *name, - hwaddr size, - BlockBackend *blk, - uint32_t sector_len, - int nb_mappings, - int width, - uint16_t id0, uint16_t id1, - uint16_t id2, uint16_t id3, - uint16_t unlock_addr0, - uint16_t unlock_addr1, - int be); - /* nand.c */ DeviceState *nand_init(BlockBackend *blk, int manf_id, int chip_id); void nand_setpins(DeviceState *dev, uint8_t cle, uint8_t ale,