From patchwork Tue Nov 5 22:47:15 2024 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: 840845 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp241373wru; Tue, 5 Nov 2024 14:54:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFoHsINsvHcC+ueIwEo1DEI3UCJrWIUgGXCrS96EIgJDQXa3Rv5lBSsJiYS5zRB02JE9UOtA==@linaro.org X-Google-Smtp-Source: AGHT+IH3wG8TLXID4h4DJh9Js1YjTRjbqL6CA5XPkj4MgXCrkvZmGonof9uV7Klld5GkwGMgI+Js X-Received: by 2002:a05:6902:2ec4:b0:e25:c732:4078 with SMTP id 3f1490d57ef6-e30e5a48509mr13647288276.14.1730847297444; Tue, 05 Nov 2024 14:54:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730847297; cv=none; d=google.com; s=arc-20240605; b=VVUw+nn1ewXpDCX/XCY06JQTH6KJ6kVaz4hoLTEGYE40SVnXjZTM9bSaej6LhZGXBM Rhp8iPb43FjqoNf36ICmDKY+v+aFl6geqhjwQwdm6FNrNWOQekHqu6d2T6wWo6Iibgi2 ajH67etFZ+FsM2yy8VHTed0G2XU9Y+uADEWHKXOFQcGVkbxAFsWIWCh8+c+B9jmZmb/E ZGs+dJEttzvH4qJqTKdzB8F9HnkHbv2ogNwf5OFGaDjdbjbO4lnJ3cenHR2G+Z6qCh8z EuJMoa8ZI8g40ixf8u5DbrjghBXzKriO5e/i9W228GyxqR3MjwCJqCYAZem1KPpawK/p Qazg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=WiFCK6mS6/8rd1MrkryQ84V1Hk6dwbxGPMWFO5fXrcw=; fh=I7y3H1hRzG+Zc0HcIfXOdhCN5cL1tidIXJb5yvpXrHk=; b=NXoSR8GekxJ4+HwrDza/D8TpxJ3/uaYT4U8LdpCK2I4rjyqIxXikPZun/EQhBHdFYa 6+qzPbGmHmOl+pC/5qgeqSJnVOobmmZDxS6CJCXkImDgMfTBaHhcIcUMoVQhvx10FiKf SIiFoP2SVzuGEkQHFcxM3d2UXF2gxmuBA60z7oq5lXHW1doG67xCZJNAH3Vkb9UvnVxP LdF09GTSORyx8zafCBFHVqlEcJjntZMpMEPPBsShaRthMmzJ/VFj7iQcsjetrqown7Dp hq+H7a9T4uf44z1y8XdBhPlPnIek7cnaKVw0St6fgbw9s2CmXDTcab3FIucQ9jmO6pN1 pV6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OhCL+EoI; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ad23fc23si138525461cf.545.2024.11.05.14.54.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 14:54:57 -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=OhCL+EoI; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8SMX-0007NU-P4; Tue, 05 Nov 2024 17:49:25 -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 1t8SMB-0006st-Eb for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:49:03 -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 1t8SM9-0004KA-NM for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:49:03 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4315baec69eso53093965e9.2 for ; Tue, 05 Nov 2024 14:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730846940; x=1731451740; 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=WiFCK6mS6/8rd1MrkryQ84V1Hk6dwbxGPMWFO5fXrcw=; b=OhCL+EoImfbNDCjfMue4sC8gaBBfRYzi/6KCLIv2jv+VQOPfWVTj6Mjy/9z75hW5sW Eh9p1KIUYgoyscKt65KmjVzOFCamx9yprHm5Lx4sugs54NsNSsQ2DzEFjh+nuQC83CPR FluXEPbLW3eP3VxhtybS4LS4k5L1T+MSaQfoQy5Egm49RZANyrAuuqc+3CdJQ48NHtQB +nNhocPJ/S60tXBp/g2xJt0774CBiESTcRZ2lpt/uBoqdB+zAKp8P/yjJbN239qRrSOy qPnMI9CCOedGJ3dm4EexOAM3J7rezdPv/CGdu9DuscCkGtDJZCY5uEqKfHC6lvFYvDqH 9WLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730846940; x=1731451740; 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=WiFCK6mS6/8rd1MrkryQ84V1Hk6dwbxGPMWFO5fXrcw=; b=leGxU9yYLZQgZuBLslvayQkjZo7UMZ5ZnuPcv96TiseT0GY2JGSGZ0izs/5SBU+Xl4 mqBS7nQFOi6EV6tAW3TUJVuf4sLqWngnjUkLzlCiIdWM8ye1iVZWddJMggCqfvISOjjr tNW5WfjWETaDshFquTfKK2NmPOtyrue3clzAasJcimhNyw0A40EcPSZFQilgQmpWPWne UidseQP1G3qXYvuAXLGv9CkbLvZn7JzkBCV9bjdDL47cT2y7bfVIXQvcUM1bBElZ3udH 9cnHLcm/oLoI/p0TZrFLpY01GviGzQlgLtFMhpTnv6KxK4xMuavjGZ5QFwUfbTTHD6Mk 0sFA== X-Gm-Message-State: AOJu0YxC6UHYTeuBg6BEYWheWkQoJiNwWbzxNNYmFt9gS45DUvoxFp3p aRjA2V890EWIzeDS+qKVALS8MX77ZyhiXVVtxZCI46mpxc46tPB8nzb+IJu9KRvo9CquDgDieRJ aFpYUjg== X-Received: by 2002:a05:600c:19d3:b0:431:54d9:da57 with SMTP id 5b1f17b1804b1-43283297d9fmr139729375e9.30.1730846939867; Tue, 05 Nov 2024 14:48:59 -0800 (PST) Received: from localhost.localdomain ([89.101.134.25]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432a267dfadsm33828605e9.0.2024.11.05.14.48.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 14:48:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 17/29] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro Date: Tue, 5 Nov 2024 22:47:15 +0000 Message-ID: <20241105224727.53059-18-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105224727.53059-1-philmd@linaro.org> References: <20241105224727.53059-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 From: Bernhard Beschow Reviewed-by: Cédric Le Goater Signed-off-by: Bernhard Beschow Acked-by: Corey Minyard Message-ID: <20241103133412.73536-13-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/mpc_i2c.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 3d79c156531..913d044ac1b 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -20,7 +20,6 @@ #include "qemu/osdep.h" #include "hw/i2c/i2c.h" #include "hw/irq.h" -#include "qemu/module.h" #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qom/object.h" @@ -345,16 +344,13 @@ static void mpc_i2c_class_init(ObjectClass *klass, void *data) dc->desc = "MPC I2C Controller"; } -static const TypeInfo mpc_i2c_type_info = { - .name = TYPE_MPC_I2C, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(MPCI2CState), - .class_init = mpc_i2c_class_init, +static const TypeInfo mpc_i2c_types[] = { + { + .name = TYPE_MPC_I2C, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(MPCI2CState), + .class_init = mpc_i2c_class_init, + }, }; -static void mpc_i2c_register_types(void) -{ - type_register_static(&mpc_i2c_type_info); -} - -type_init(mpc_i2c_register_types) +DEFINE_TYPES(mpc_i2c_types)