From patchwork Mon Jan 9 12:08:27 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: 640625 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2103202pvb; Mon, 9 Jan 2023 04:25:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3eCI/BC4alWNMrRAPwG607rV5sfvQAHmTKsCKAcThFTl4OH9ELnxaGG3vt3IHk2yDEQKN X-Received: by 2002:ac8:6049:0:b0:3a7:f5fc:7cad with SMTP id k9-20020ac86049000000b003a7f5fc7cadmr86017960qtm.62.1673267149656; Mon, 09 Jan 2023 04:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673267149; cv=none; d=google.com; s=arc-20160816; b=DpbW0LOKx+6dSifyblf99kKiSCp+FZ1k1Nvfctnzkz+OW4d/QXUphdnl5bzLxU7ncB 6w3FIyHoOZUuX7diVljMUrgeFOoZT7mW98sv/z2+SbaDrlsDwtkUz39PpVsxdjWwZYj+ NjzdUfzdP7ZzPeCKCxwLjAiBqvcK09crUSBLiDSPSF2a2utygFkP0fJCTWV6JS4ob/r9 R/s1AE62ox3WtnVPF1pmETITuUTc+FkrfSa5veOs1kwueDGK+eDeNiSjodNGaz3QjeE4 FWa7apccqWGanpYsAZ9bQ5tKK5TOVYxS2ta2s9dJSgJpFHVEOTSFI9+ohhfwbxjjjfTN ApsQ== 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=ZIp3JsnCZxhXt6GT6aUhF32nL0uOIOLvhkTscuIIgmA=; b=PD3wloqFk+Ri4uWG24z3mR7unz3c5ptVx0fs+U75h7jnplSmDGmlNYsvsWHTJy7foK xZtTX5ZiBrRd+FzsPKaJRne5LSuOFnCVbqHFFbMFXPmgWBIPJsxuxppTeaIxuDssrWZw Ja6aefG82Cisx3rSwYiE6hLMtI3H22xTQhnjqJxfParAEz/0cAcyyHeRAVf5YTiXS/4c 8fY6FircoyruqVldRh3hvlr3HGFhT0ul1Puwt/X5IkicfgVlFBro26godA7MqMTESvoQ kd+L/XQwdAZhZMKuapdIF9D+8km74eCeDH5l0gdlbQVAu0aX3+CAKoKucOOVAzRUUfS6 L22Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2CJAPUO; 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 l6-20020ac81486000000b003a690945588si4186834qtj.684.2023.01.09.04.25.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 04:25:49 -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=O2CJAPUO; 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 1pEqyP-0000JC-61; Mon, 09 Jan 2023 07:09:53 -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 1pEqyL-0000IG-Ne for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:09:49 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEqyJ-0006Gz-O7 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 07:09:48 -0500 Received: by mail-wm1-x32b.google.com with SMTP id g10so6105814wmo.1 for ; Mon, 09 Jan 2023 04:09:47 -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=ZIp3JsnCZxhXt6GT6aUhF32nL0uOIOLvhkTscuIIgmA=; b=O2CJAPUOscrVtvbWCVYbN/6KrlrQXvAJmRdO16IY93pr6Pax3O33dgeTmtrnlEFQ4v PGzNsA7RG2f4m9LKZVgHMK/nbRpGVy97J94FaXbKkT0PeVj4R2Hg1vCd0PsNz1NsCFl1 3HQX3VsjNlbrOuozmkY9ces+WVJyV8dbT6tcLkKUWUxRMyadaI+cRDUTbytJ97R1ogo4 eUrCHuzhfClvJnwsey09Fdu9S0U6zxaNhsYVlpw6H8/ZPhS1Gg+83tV5nMh0HtCKaBF5 tBf/UuiwCsteXg41tSyM9p0sCecTfcHJ6cvLHIcVaAe94pyBePJHwNibUq3XFnc5YWbT WQaw== 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=ZIp3JsnCZxhXt6GT6aUhF32nL0uOIOLvhkTscuIIgmA=; b=r5TWNvzAGHisulV+CbaZktUMsojQvfeWDH1yyvrU5sIqZ8O58Bbr4DJNvx6Z0ZwIlJ a4C25QK3G55gIGwGT2793IxVmcGHieSDT7ygyoXd3yVpFi7AVVuwtovdD6Z9eePdeitK TfdJ6LqtyNyeO4Jh77bpWRo5+qoYwoyDXpGGh+uuSoZ4oouQ0HrF8BAHpb66uD8inezT TipbJGQy2c0Jxoi0ht+BHCv8JbJDHR6uSxFV+DI0MWzcQbFPeEkYugecCQ8zuJr0zkJu C52Pc+bi2x7XLkgxMg8KKdFm/dlblJ5Ku75UaT2iJ7b6iF+HuGtB3M4dKcpV6RsxGJrT 34Uw== X-Gm-Message-State: AFqh2koXsNuqkZQ+GIroyydYftLBlFwxNn2n47XNx0yMPkg2WTS6sa+o McvrTT9d7oGU1tvLHJ5oa4QbbhGTJURgvrDs X-Received: by 2002:a05:600c:5116:b0:3d9:f296:1adc with SMTP id o22-20020a05600c511600b003d9f2961adcmr1341676wms.33.1673266186309; Mon, 09 Jan 2023 04:09:46 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id u8-20020a05600c19c800b003d9780466b0sm12398079wmq.31.2023.01.09.04.09.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 04:09:45 -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 15/21] hw/block: Make PFlashCFI02 QOM declaration internal Date: Mon, 9 Jan 2023 13:08:27 +0100 Message-Id: <20230109120833.3330-16-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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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 Convert the QOM PFlashCFI02 to a forward/opaque pointer declaration. Only pflash_cfi02.c is able to poke at the internal fields. Reviewed-by: Bin Meng Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi02.c | 2 ++ include/hw/block/flash.h | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index 6168e66d7e..ba035d8d42 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -63,6 +63,8 @@ enum { WCYCLE_AUTOSELECT_CFI = 8, }; +OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI02, PFLASH_CFI02) + struct PFlashCFI02 { /*< private >*/ SysBusDevice parent_obj; diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h index d615bf6a53..aeec4a369b 100644 --- a/include/hw/block/flash.h +++ b/include/hw/block/flash.h @@ -6,9 +6,8 @@ #include "exec/hwaddr.h" #include "qom/object.h" -/* pflash_cfi01.c */ - #define TYPE_PFLASH_CFI01 "cfi.pflash01" +#define TYPE_PFLASH_CFI02 "cfi.pflash02" OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI01, PFLASH_CFI01) @@ -25,11 +24,6 @@ BlockBackend *pflash_cfi01_get_blk(DeviceState *dev); MemoryRegion *pflash_cfi01_get_memory(DeviceState *dev); void pflash_cfi01_legacy_drive(DeviceState *dev, DriveInfo *dinfo); -/* pflash_cfi02.c */ - -#define TYPE_PFLASH_CFI02 "cfi.pflash02" -OBJECT_DECLARE_SIMPLE_TYPE(PFlashCFI02, PFLASH_CFI02) - /* nand.c */ DeviceState *nand_init(BlockBackend *blk, int manf_id, int chip_id);