From nobody Tue Feb 10 20:28: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; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527518964965903.5923211767954; Mon, 28 May 2018 07:49:24 -0700 (PDT) Received: from localhost ([::1]:56603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNJSe-0001l5-AI for importer@patchew.org; Mon, 28 May 2018 10:49:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNJOf-0008O8-0x for qemu-devel@nongnu.org; Mon, 28 May 2018 10:45:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNJOa-0005dW-2A for qemu-devel@nongnu.org; Mon, 28 May 2018 10:45:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52352 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fNJOZ-0005c2-Qt for qemu-devel@nongnu.org; Mon, 28 May 2018 10:45:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 20906BD9E; Mon, 28 May 2018 14:45:11 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-100.ams2.redhat.com [10.36.116.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D79C111166F7; Mon, 28 May 2018 14:45:10 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id A6BDC1138658; Mon, 28 May 2018 16:45:09 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 28 May 2018 16:45:06 +0200 Message-Id: <20180528144509.15812-2-armbru@redhat.com> In-Reply-To: <20180528144509.15812-1-armbru@redhat.com> References: <20180528144509.15812-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 28 May 2018 14:45:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 28 May 2018 14:45:11 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v4 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@linaro.org, thuth@redhat.com, pbonzini@redhat.com, f4bug@amsat.org, ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 SMBusDeviceClass::init is no more used, remove it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180419212727.26095-2-f4bug@amsat.org> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- hw/i2c/smbus.c | 9 --------- hw/i2c/smbus_eeprom.c | 5 ++--- include/hw/i2c/smbus.h | 1 - 3 files changed, 2 insertions(+), 13 deletions(-) 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; 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); --=20 2.13.6