From nobody Wed Feb 11 03:03:25 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 1516622774443658.9430606483437; Mon, 22 Jan 2018 04:06:14 -0800 (PST) Received: from localhost ([::1]:38050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edard-0005Fy-MM for importer@patchew.org; Mon, 22 Jan 2018 07:06:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edapX-0003tH-4m for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:04:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edapW-0000Cj-2D for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:04:03 -0500 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:35486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edapV-0000CW-Uu for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:04:02 -0500 Received: by mail-qt0-x242.google.com with SMTP id g14so10832639qti.2 for ; Mon, 22 Jan 2018 04:04:01 -0800 (PST) Received: from x1.local ([138.117.48.219]) by smtp.gmail.com with ESMTPSA id 92sm11295356qky.72.2018.01.22.04.03.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 04:04:00 -0800 (PST) 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=+4K3gwG1Nyq+oAa5oSOabGvI8GF8/zoxQTXnvJHy5+0=; b=lS6uB7vOOukuCRyI0TqPDl+/CxkkeFhXSDqFeZvwRjM3/lPyZ74jjAwJG4YkXbrq7Q c+IazhCI6WKxYqXYAaYogw9JASocnvNNQ3MlIL25frqOW77gLCVJVcRBCrryWMW/rliV 2TsRUv2QFZ4Pg17cOgj65W5Ma0mcgcBT5T8xg8vUfMH7pl+Ot4kXJz+IHQm2j76LTYR0 Qt2dgULfirff+cuvTEyI0qmRw/VcPj2cf8+kJ9YNqRMdpJAAKxxonbeSUdQe0uX4fTmk g+lCwc+MYD8HWUvntsdHqKsui10l15mpliZNkQCgqsjRFm2EmZIoKKKXPoxlVqFowrqz r1Zw== 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=+4K3gwG1Nyq+oAa5oSOabGvI8GF8/zoxQTXnvJHy5+0=; b=PolO2cwM8GJ/7VKw72D8+fWhQ8JZUnqMCHt5Ohh+rcRAmtNc08O37EhB0VEkIGwh22 jTqsngxc/0QV/GsoaN8yr+qA3FwLc05ETOWlLIW1Sa6bZg4AdOIF+quY4TILm+h0Mag5 2ZutcRdZjt4gWiBjZF0A70//zWcyOOeiuci/LUhtIyuEncijL1gEYR6EhI1o9JHLo1jZ sAQNmL85woOg8nphoPhx79nCXxEbJQeLQtyaYQTEJDXrUkmLNwieQxeC69Qxri03KPwC yZxVECmRbnnvj08g0FHeKoOyGafOGwlTmOLdEqFdA596/OfWnTT0Nep5FdVIRqTOD8NW IIRg== X-Gm-Message-State: AKwxytd/40AABuLidEOEtGHAYJnHn1hjfzzZpokmbcLmlyGAU37wbF98 oQJPdjQJOydh4i9vtPAg3X4= X-Google-Smtp-Source: AH8x22488wmDepQv9ITabNdfw/ozP4FSoSfx9n/fBIY4jmsIi5i4NKuYfgnbYipB/v/MtqGnsMtYlw== X-Received: by 10.200.81.193 with SMTP id d1mr11157726qtn.109.1516622641428; Mon, 22 Jan 2018 04:04:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Eduardo Habkost , Paolo Bonzini Date: Mon, 22 Jan 2018 09:03:45 -0300 Message-Id: <20180122120351.22369-2-f4bug@amsat.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180122120351.22369-1-f4bug@amsat.org> References: <20180122120351.22369-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:c0d::242 Subject: [Qemu-devel] [PATCH v2 1/7] 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 , Markus Armbruster , 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 and remove SMBusDeviceClass::init, there are no more users. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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.15.1