From nobody Sat Nov 23 23:25:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1730553571; cv=none; d=zohomail.com; s=zohoarc; b=n4k/OfP1W4f56eYNbz20c8RKQVTWWQHcdQcLJAGLbFzjX4d3R2m7n+Vk1lXzy8HDURP7qIbKGO9MhQuWRMKhnQwVPHk9OutbM9bYsCKj22clXC4KWo921YJSMpY5HWGKCSZRrimGi+QmIJpWQRkZejKMZeeX8jupW05SjVQfONE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730553571; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=80K8OEm+6o8+JzT+l+kkS4hvMpMoaCr4IlAQyLMMIO0=; b=lIxjK2UBeQ6QisLF8R3IeyUgk/rU7GHi36RtkTsDe/2fTa9qtiiUrhJFb0mm0NXBeBXLHUPffb/gBLnIWlACVHStys+xuE2Hi9LLx1/3ueJBHpWWsJoqTfAW427BrOjnPBoK96S6LhDu/i40d+gOM66D87sx6mw1wzzUgKiXCjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730553571576284.1744263758811; Sat, 2 Nov 2024 06:19:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7E1F-0003qE-EW; Sat, 02 Nov 2024 09:18:21 -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 1t7E0w-0003CX-Ca; Sat, 02 Nov 2024 09:18:03 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7E0t-00021Z-Jq; Sat, 02 Nov 2024 09:18:02 -0400 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a9a0c40849cso466753266b.3; Sat, 02 Nov 2024 06:17:57 -0700 (PDT) Received: from archlinux.. (pd9ed7f6d.dip0.t-ipconnect.de. [217.237.127.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e5664350esm307859066b.159.2024.11.02.06.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Nov 2024 06:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730553476; x=1731158276; 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=80K8OEm+6o8+JzT+l+kkS4hvMpMoaCr4IlAQyLMMIO0=; b=BFfG5T/rUvOzrgrN75/IYmqpYe3ifhGfePovRTpqu8n2C79AiVupW1slomcMSHuG7u gG0GmqLm11T64pBzOhF9xMgt/LN77tEhDq8q+1gxs4Fn8NMlxzjICLSReemShzkXsPew hyqPPnYvWhYors8T7ZlvUNoye3AZzWmD3c6zWKj2OvU9aYHdHfJnOrn6l+8fj2+cGZ/9 sCPNpgA1Fw1szgRsCgySkg39wiOwPxofLQetc+TMYyd/Gb68EEMxsxZoj9r3EGcN0Iia H7VyO3lyimT8H253NKLs4nF+bA+1PQ1CHA3IL/oJmgrACrW7xJByQviJJGcRUFKvhKLi Z93g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730553476; x=1731158276; 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=80K8OEm+6o8+JzT+l+kkS4hvMpMoaCr4IlAQyLMMIO0=; b=rIRheHFJMT3kdoYlAb8JdtzmFxPXuYGi+P4N6ho1BmYrjIeO63vW6wDARBqMxvoosT eizTUUrgVz9tpzakts0pL+Rqb6wBdlHarqso+E0KSrSI8SG8E0zH6I9vnst7PpqpEkWf vUiH6NuTCBk5ZRAiZmkhThnbkaFicS+DwJMmfmzpkmRwyUJN9WVR1XqjtGsKkXF3X3mz P4+C/02lzpF3kyncjIEiiVqgbACbY0ae+nOvTiLCAtPCVBPcoR8Hwjj0IquzLGGPifv0 vJmBA/INVtoMPRM629gbrratmSODgeOqH3JBzGqrDaXxzYpw3VPvCelQOs4ruKDvgrI9 gsHw== X-Forwarded-Encrypted: i=1; AJvYcCVkiVJ0MtjiPAMLpN7xnJDB5RK7T8x7yErWHUfXkrto6NNqIvDJdPIEXHeRe6c0Hb3R3h4cvToEcO/B@nongnu.org, AJvYcCWOf02X0VJiCyuBqNO6RL0BnKbsndmwCSbkldV2BqnkEf+tvdRuP8T6uir4Nzf8JYuAtjhPL3DxReg=@nongnu.org X-Gm-Message-State: AOJu0Yzz4ouA9n76g65+Rfy3whe7eStiZPMipftXywlgAakele8qR9WM HOVwMC2w+e86DHnM0LREjPKXyH9Yw5vRekym5YSnmn6TRV4PurujTzlJtg== X-Google-Smtp-Source: AGHT+IF7MDxOK6ZyXd9DeicGn8UMo/EyghaXt22av+4QTbbaetScuZ5Elw8H4a1AJwqr9pLayDfjnw== X-Received: by 2002:a17:907:9722:b0:a99:403e:2578 with SMTP id a640c23a62f3a-a9e3a57531amr1445849466b.5.1730553475978; Sat, 02 Nov 2024 06:17:55 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-block@nongnu.org, Bin Meng , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jason Wang , Bernhard Beschow , Daniel Henrique Barboza , Kevin Wolf , Hanna Reitz , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Alex Williamson , qemu-ppc@nongnu.org, Corey Minyard Subject: [PATCH v3 20/26] hw/sd/sdhci: Prefer DEFINE_TYPES() macro Date: Sat, 2 Nov 2024 14:17:09 +0100 Message-ID: <20241102131715.548849-21-shentey@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241102131715.548849-1-shentey@gmail.com> References: <20241102131715.548849-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=shentey@gmail.com; helo=mail-ej1-x62f.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, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1730553572383116600 Reviewed-by: C=C3=A9dric Le Goater Signed-off-by: Bernhard Beschow --- hw/sd/sdhci.c | 62 +++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index ed01499391..aa89513796 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -37,7 +37,6 @@ #include "migration/vmstate.h" #include "sdhci-internal.h" #include "qemu/log.h" -#include "qemu/module.h" #include "trace.h" #include "qom/object.h" =20 @@ -1598,15 +1597,6 @@ static void sdhci_sysbus_class_init(ObjectClass *kla= ss, void *data) sdhci_common_class_init(klass, data); } =20 -static const TypeInfo sdhci_sysbus_info =3D { - .name =3D TYPE_SYSBUS_SDHCI, - .parent =3D TYPE_SYS_BUS_DEVICE, - .instance_size =3D sizeof(SDHCIState), - .instance_init =3D sdhci_sysbus_init, - .instance_finalize =3D sdhci_sysbus_finalize, - .class_init =3D sdhci_sysbus_class_init, -}; - /* --- qdev bus master --- */ =20 static void sdhci_bus_class_init(ObjectClass *klass, void *data) @@ -1617,13 +1607,6 @@ static void sdhci_bus_class_init(ObjectClass *klass,= void *data) sbc->set_readonly =3D sdhci_set_readonly; } =20 -static const TypeInfo sdhci_bus_info =3D { - .name =3D TYPE_SDHCI_BUS, - .parent =3D TYPE_SD_BUS, - .instance_size =3D sizeof(SDBus), - .class_init =3D sdhci_bus_class_init, -}; - /* --- qdev i.MX eSDHC --- */ =20 #define USDHC_MIX_CTRL 0x48 @@ -1882,12 +1865,6 @@ static void imx_usdhc_init(Object *obj) s->quirks =3D SDHCI_QUIRK_NO_BUSY_IRQ; } =20 -static const TypeInfo imx_usdhc_info =3D { - .name =3D TYPE_IMX_USDHC, - .parent =3D TYPE_SYSBUS_SDHCI, - .instance_init =3D imx_usdhc_init, -}; - /* --- qdev Samsung s3c --- */ =20 #define S3C_SDHCI_CONTROL2 0x80 @@ -1946,18 +1923,31 @@ static void sdhci_s3c_init(Object *obj) s->io_ops =3D &sdhci_s3c_mmio_ops; } =20 -static const TypeInfo sdhci_s3c_info =3D { - .name =3D TYPE_S3C_SDHCI , - .parent =3D TYPE_SYSBUS_SDHCI, - .instance_init =3D sdhci_s3c_init, +static const TypeInfo types[] =3D { + { + .name =3D TYPE_SDHCI_BUS, + .parent =3D TYPE_SD_BUS, + .instance_size =3D sizeof(SDBus), + .class_init =3D sdhci_bus_class_init, + }, + { + .name =3D TYPE_SYSBUS_SDHCI, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(SDHCIState), + .instance_init =3D sdhci_sysbus_init, + .instance_finalize =3D sdhci_sysbus_finalize, + .class_init =3D sdhci_sysbus_class_init, + }, + { + .name =3D TYPE_IMX_USDHC, + .parent =3D TYPE_SYSBUS_SDHCI, + .instance_init =3D imx_usdhc_init, + }, + { + .name =3D TYPE_S3C_SDHCI, + .parent =3D TYPE_SYSBUS_SDHCI, + .instance_init =3D sdhci_s3c_init, + }, }; =20 -static void sdhci_register_types(void) -{ - type_register_static(&sdhci_sysbus_info); - type_register_static(&sdhci_bus_info); - type_register_static(&imx_usdhc_info); - type_register_static(&sdhci_s3c_info); -} - -type_init(sdhci_register_types) +DEFINE_TYPES(types) --=20 2.47.0