From nobody Sun Dec 6 20:46:10 2026 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=1796209583; cv=none; d=zohomail.com; s=zohoarc; b=kXXyIMunSYZ8DjHRHuK6WKzQm88hU87eAc5u30/TxZ3c5P0MteqT1PhdaaM7BxJrbocyERmA64T17RshhtGqLYjXiSWjUJA/DIrShMT6qflWYwuTzP3xVZU+I2YOcc7XBKdi/E8IHgqHllW+Xssq2mwmjMOUJAP7tYAMHqQPLrI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796209583; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JaBipe6mlFhiwg5+eGPjqiCPJPV3yvQgiO8c/C5qovs=; b=G45uJRpy870fIhxx0Oomgo5milnB2mNEq1r5d2Kf4lT0zPI7nBjJKFU/O4g6KMKIqhnCpULbXDZd7nxDTBMEnu+mmm4TGvGRERjngxBv8VAuGOkhrE4/XBe6OfI1ojd8HcSa1IHqMNTD+TdnkhWUU166aRoHdOa8IepJS3Z570o= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1796209583408654.110201310537; Wed, 2 Dec 2026 03:06:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xYi9w-0005Si-OD; Wed, 02 Dec 2026 06:06:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xYi9v-0005SY-NY for qemu-devel@nongnu.org; Wed, 02 Dec 2026 06:05:59 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xYi9u-0000My-0p for qemu-devel@nongnu.org; Wed, 02 Dec 2026 06:05:59 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-3b532dfb874so3718352a91.3 for ; Wed, 02 Dec 2026 03:05:57 -0800 (PST) Received: from cfarm136.osuosl.org (cfarm136.osuosl.org. [2605:bc80:3010:104:21e:67ff:fefd:7034]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b50234fb25sm16479766a91.2.2026.12.02.03.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 03:05:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796209556; x=1796814356; darn=nongnu.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=JaBipe6mlFhiwg5+eGPjqiCPJPV3yvQgiO8c/C5qovs=; b=phVxNPXwysAQ2yk+vetsnRAdQh5I0zSubJX/MOG+BAmkLJAWzAZuROr9hWT78lelOX f23o8bQbfh9JH+C+gCQzsSv/HzRcPbPfZgjS9Sgy1T8KCTd+htOFlMdGbvMR/Ndx45HW fOHpzNhkJTCDpCnBFXfmFZKhcNNr5bo03kqm1+pXoObm8S1q9BU2+szL7nUhojmyqyl3 K/XKABDIalw8kFtsvvNhCk6GGO8I6BROM1P5qkbc6szukVuFSNK+dK1ulKIqPFEcQINd 0ggd1NRLo6Bki0nt4swqDrogGWJmNghUVSuyyVK5DnfBpZQPRSUXxoQtq9Xv3m4DkZ9U EpAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796209556; x=1796814356; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=JaBipe6mlFhiwg5+eGPjqiCPJPV3yvQgiO8c/C5qovs=; b=sSJkYL2DR5jujM6utIrP1cwrXoQNYRT+0IAN0WGkMWFMPp/QIx+5Eq9JIYi4ZjfTtg QAWWWI5NXAhIQmUKl00pIGAerNz7eCcoUqsNye0AobCIwwMUKOJtwr1rHdcjiB7cHLnU bAaDfzRHcsYvHqsobeDX90ZHp69JSC3EW9sme8K34UOrvpuzAHxkqaEdTGpZHsMgd4EE oKA8gX0oD4cDvmDoIPub+Ml+12pN9WCI1uvzt/VL/dA3LFgexhXq8dLUXAGtWYzCgf9S r4T5FL7eLq0q/KH6YT8PK3RyruWWL1i1wqJgWNW2ahhRc7TBlAW/loqYa96W9xH9O50u TBdg== X-Gm-Message-State: APuU4Z+HRycnDp0ntD5XcxXHWeBZ5VfZ5S44aU/a+/rxbXgaAAJl4dYO /DBrPpdv4DJEjrCiskkW1Uop80dbwnFWkFADW5jUpnF9QNlgBK8nVgCz X-Gm-Gg: AZFdTZf8Qry0JxQJjaokYgucQOKdAgBnHt5EvaX55Jn02wXShfy2iCsULVrwbbvZaht 9KNHxom7sXgihXLujC8TZ6TrZHKX3hkYkrPEDMyX+iuD43fkBQJYsl81QD6yCGMjiNvWXp4VFso Nue8ZHattJf63ziWkckYZ4wLumjJkDB+3BQ1AL2UW+30S44SkXiL1zjNE3vu79+cOfmteTcwJnp mqpSA8effg2Is5Ps3PomL4mscTJa3KK1ZJ8W27ek9RXJXhwLx7vrs0kHbAEaSJoxwBCAVg+Cp+t PbheD2y+u56n2BEy2NVeTwiy44XvN/zkvBs6MlPMD/9gS3lDquWAABuu98WtuRkbQ8EZbZhDb+C /huk2G81AQgRToO4nYE83oUamRNoQesl0UWMVpWpjGDsqs8xpMlBaQjUeAmKfZAZP4rny+Bb2p9 AN4OHgpj2ITLAEdbg6X+rqDGDDK0igi6nWjK9p+VnXqPbFrJjqNSw1iypxMhvdZWWsBP+jjjOTr mM1BFiRfS05IHP6PZ9Vcc3xtO+6yEjMgrM+R2gfea/d8y30Oq0vfKeCDyqYzlzQZ+XNdGBmKYNb JuwUZh7qtUvalPjezHm4aButzjBbTO6I85Ief6/srH3nhAk5Y9mbqacSbQgavCDIPhxXJkukaSj 0y2FOMjMJiIxY867bzt2MDhFru60Xe+s= X-Received: by 2002:a17:90b:1dcd:b0:3b0:968f:fdef with SMTP id 98e67ed59e1d1-3b41c9758d8mr42904333a91.49.1796209556466; Wed, 02 Dec 2026 03:05:56 -0800 (PST) From: =?utf-8?q?Oscar_Alejandro_S=C3=A1nchez_Lucero?= Date: Wed, 02 Dec 2026 11:05:55 +0000 Subject: [PATCH] hw/i2c/smbus_eeprom: Convert to Resettable interface MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20261202-i2c-smbus-eeprom-resettable-v1-1-f1851d7ac10e@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMSwrCQBBF0a2EGltgN0HFrYiD/rzEEvOhqiNCy N5t4+TCmdyVDCowujYrKd5iMo0V7tBQeoSxB0uuJn/0J1fD4hPbEBdjYNZpYIWhlBBf4PaSOxd De3Y5Uz3Mik4++/12/9uW+EQqvyVt2xdV6rWTfwAAAA== X-Change-ID: 20261202-i2c-smbus-eeprom-resettable-48df1ba471dd To: qemu-devel@nongnu.org Cc: Corey Minyard , =?utf-8?q?Oscar_Alejandro_S=C3=A1nchez_Lucero?= X-Mailer: b4 0.16.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=aleszlucero@gmail.com; helo=mail-pj1-x1033.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: qemu development 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: 1796209584996158501 Replace the deprecated device_class_set_legacy_reset() with the Resettable = interface by implementing the hold phase in smbus_eeprom_reset_hold(). Signed-off-by: Oscar Alejandro S=C3=A1nchez Lucero --- hw/i2c/smbus_eeprom.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 693d476..d1ed109 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -117,9 +117,9 @@ static const VMStateDescription vmstate_smbus_eeprom = =3D { * the contents and restore that on startup, and not do this on reset. * But until that time, act as if we had been stopped and restarted. */ -static void smbus_eeprom_reset(DeviceState *dev) +static void smbus_eeprom_reset_hold(Object *obj, ResetType type) { - SMBusEEPROMDevice *eeprom =3D SMBUS_EEPROM(dev); + SMBusEEPROMDevice *eeprom =3D SMBUS_EEPROM(obj); =20 memcpy(eeprom->data, eeprom->init_data, SMBUS_EEPROM_SIZE); eeprom->offset =3D 0; @@ -129,7 +129,7 @@ static void smbus_eeprom_realize(DeviceState *dev, Erro= r **errp) { SMBusEEPROMDevice *eeprom =3D SMBUS_EEPROM(dev); =20 - smbus_eeprom_reset(dev); + device_cold_reset(dev); if (eeprom->init_data =3D=3D NULL) { error_setg(errp, "init_data cannot be NULL"); } @@ -138,10 +138,11 @@ static void smbus_eeprom_realize(DeviceState *dev, Er= ror **errp) static void smbus_eeprom_class_initfn(ObjectClass *klass, const void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); SMBusDeviceClass *sc =3D SMBUS_DEVICE_CLASS(klass); =20 dc->realize =3D smbus_eeprom_realize; - device_class_set_legacy_reset(dc, smbus_eeprom_reset); + rc->phases.hold =3D smbus_eeprom_reset_hold; sc->receive_byte =3D eeprom_receive_byte; sc->write_data =3D eeprom_write_data; dc->vmsd =3D &vmstate_smbus_eeprom; --- base-commit: 9751c62358073580cbf330a4df22077a7c6a407c change-id: 20261202-i2c-smbus-eeprom-resettable-48df1ba471dd Best regards, -- =20 Oscar Alejandro S=C3=A1nchez Lucero