From nobody Wed Feb 11 05:17:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524173603735736.1869147981887; Thu, 19 Apr 2018 14:33:23 -0700 (PDT) Received: from localhost ([::1]:50221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9HB7-0006nt-PA for importer@patchew.org; Thu, 19 Apr 2018 17:33:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9H5g-0002Ui-BE for qemu-devel@nongnu.org; Thu, 19 Apr 2018 17:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9H5f-0007q0-6W for qemu-devel@nongnu.org; Thu, 19 Apr 2018 17:27:40 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:41032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9H5f-0007pt-2d for qemu-devel@nongnu.org; Thu, 19 Apr 2018 17:27:39 -0400 Received: by mail-qk0-x243.google.com with SMTP id s78so6875730qkl.8 for ; Thu, 19 Apr 2018 14:27:39 -0700 (PDT) Received: from x1.local ([138.117.48.212]) by smtp.gmail.com with ESMTPSA id c137sm3571570qkb.2.2018.04.19.14.27.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 14:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zELgoYDzGU3fDdYNoouzqga/mxuq1p+k7A8ydcrEQIQ=; b=pHRSyd81vZ04cQPFelTK65FBBMFRBsuK36LBFguqwGD10Js6DLc1wg4Y2epjRa+CcK LzBHSno1AAqiLwCqFhZHPQFk+QEFZW+VWddhwCFmrKOb2jzWxBF8eIqnsHCh+4rf1KPB 8o33z/0erDnCWbcWtEJzyVIK/e/MK2w+pC/FBqZi/9Iosrv5lTHwaxf6RCBdSnAhw9K/ 5oLmmvdCXu5fUt31KBGO3VPmcubTBM/fgEEA8oGnjHDrVueBQXX7R8RiD46sYDfuclk8 adhxRyYmouDURfad6xuQTEBK61OiRM9pEDkcLn5Uy7fO7NUY+9GIdtMbX5tYjWgGbQf7 HKAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zELgoYDzGU3fDdYNoouzqga/mxuq1p+k7A8ydcrEQIQ=; b=jgLtXfi+IHG+sV5rcEvf+1huKZhASP7EhdJOrki9MniGZHeBcr1UBWMJMPeDUh/aWw ReDCRCMOk+zRJY98N9/W8YAqWn26+hNg3H7xa9tNNraVC1H0eh63pTlRZpxM1Xl8u2t0 /AWX/P6bHE4xjSsSJRD3ckPVkC5qoqDu4EYS7CYoAQKuxPI+UfFFtR5bTVvUOec13wJh 9HoUOVMIMRj+0neWO6GpPaSo5boJYo16G1+UHsD2WHmX86USHL0I+U1QpZQa7JMRlcmQ LPEa3vxpFSM/DMJUzE1PNOTl+JMlwRvkQE3qef8cexxQXnKGkKVN2Qxoe7TfmsTsEL3q b5Pg== X-Gm-Message-State: ALQs6tCLGJtzquzvoF6ZGlM9/HpPAYZ2QUSK+oOuaPcNfzG6TH/048IM RsXJjGS+2SxUt0kORMsEfd1umMwq X-Google-Smtp-Source: AB8JxZokJJhj7dMyeTXigbF1CD2QMXqLJNYJA92vgp9tKqa02de0HQtUvvJ+M0++CzLrAcQ0cRIesw== X-Received: by 10.55.185.69 with SMTP id j66mr7859543qkf.216.1524173258625; Thu, 19 Apr 2018 14:27:38 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , Markus Armbruster Date: Thu, 19 Apr 2018 18:27:24 -0300 Message-Id: <20180419212727.26095-2-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419212727.26095-1-f4bug@amsat.org> References: <20180419212727.26095-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH v3 1/4] hw/i2c/smbus: Use DeviceClass::realize instead of SMBusDeviceClass::init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 SMBusDeviceClass::init is no more used, remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- include/hw/i2c/smbus.h | 1 - hw/i2c/smbus.c | 9 --------- hw/i2c/smbus_eeprom.c | 5 ++--- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h index 544bbc1957..cfe3fa69f3 100644 --- a/include/hw/i2c/smbus.h +++ b/include/hw/i2c/smbus.h @@ -38,7 +38,6 @@ typedef struct SMBusDeviceClass { I2CSlaveClass parent_class; - int (*init)(SMBusDevice *dev); void (*quick_cmd)(SMBusDevice *dev, uint8_t read); void (*send_byte)(SMBusDevice *dev, uint8_t val); uint8_t (*receive_byte)(SMBusDevice *dev); diff --git a/hw/i2c/smbus.c b/hw/i2c/smbus.c index 2d1b79a689..587ce1ab7f 100644 --- a/hw/i2c/smbus.c +++ b/hw/i2c/smbus.c @@ -202,14 +202,6 @@ static int smbus_i2c_send(I2CSlave *s, uint8_t data) return 0; } =20 -static int smbus_device_init(I2CSlave *i2c) -{ - SMBusDevice *dev =3D SMBUS_DEVICE(i2c); - SMBusDeviceClass *sc =3D SMBUS_DEVICE_GET_CLASS(dev); - - return sc->init(dev); -} - /* Master device commands. */ int smbus_quick_command(I2CBus *bus, uint8_t addr, int read) { @@ -350,7 +342,6 @@ static void smbus_device_class_init(ObjectClass *klass,= void *data) { I2CSlaveClass *sc =3D I2C_SLAVE_CLASS(klass); =20 - sc->init =3D smbus_device_init; sc->event =3D smbus_i2c_event; sc->recv =3D smbus_i2c_recv; sc->send =3D smbus_i2c_send; diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index b13ec0fe7a..125c887d1f 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -97,12 +97,11 @@ static uint8_t eeprom_read_data(SMBusDevice *dev, uint8= _t cmd, int n) return eeprom_receive_byte(dev); } =20 -static int smbus_eeprom_initfn(SMBusDevice *dev) +static void smbus_eeprom_realize(DeviceState *dev, Error **errp) { SMBusEEPROMDevice *eeprom =3D (SMBusEEPROMDevice *)dev; =20 eeprom->offset =3D 0; - return 0; } =20 static Property smbus_eeprom_properties[] =3D { @@ -115,7 +114,7 @@ static void smbus_eeprom_class_initfn(ObjectClass *klas= s, void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); SMBusDeviceClass *sc =3D SMBUS_DEVICE_CLASS(klass); =20 - sc->init =3D smbus_eeprom_initfn; + dc->realize =3D smbus_eeprom_realize; sc->quick_cmd =3D eeprom_quick_cmd; sc->send_byte =3D eeprom_send_byte; sc->receive_byte =3D eeprom_receive_byte; --=20 2.17.0