From patchwork Tue Mar 7 07:08:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 659726 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2245649wrb; Mon, 6 Mar 2023 23:14:28 -0800 (PST) X-Google-Smtp-Source: AK7set/zYkDQiIEpSwTy9ELymeOooHP/7dEQCfGzCfl87giDrumJnaVZWyuCX0cQfwqWyCZq6c4U X-Received: by 2002:a05:6214:2484:b0:56e:c18d:ca79 with SMTP id gi4-20020a056214248400b0056ec18dca79mr26606484qvb.30.1678173267813; Mon, 06 Mar 2023 23:14:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678173267; cv=none; d=google.com; s=arc-20160816; b=E+rnjsAO9DGpRb/YA5WbK7YiOy70IYMSKkZdg3XBHvDH0JC4yyhzxwAaTGQXWAEFx4 h/Av7b7mojWY/BswYwWRZDxQ8nRzqzubB6x2DFCza/htH+dKvbvApmqAVzbKRjnRyuJm KmLXwJdoLTHxObc5hyu3M+XqyYwW1loGqbd/bb21j7sVA1SIasrc97SSadp4jgA/Js3N 99zPvbf9WcjkazE6jOelJWJhF5xxBMryewPqYPoI/5RMzRZlaWV9D45kLvSf2sxz7oma L/Yy3+lcCCZognO1G0uj1URfZBUUqgnMrN/1s4pFHrn1+hYkP7Ywxqocz9qTquBkXoKz bNzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=upOlGMHWjHNNBfJuoRRwinF5pbnBznfwUp5wdi6JWFY=; b=u5iwxGVVnKaiLzxvmH7U7WFAsPBXmYhzbqO+A/z4IxZb5YHPsBbj/fiukfOzBksBpH /+ILn7i3+kQ3qi7xkM1lIToyfnVRkrwaJp6NIOK1y9qpftVY81WEXKoLOt8khMcvCeAd D6oZzHd5aQjw+nRTZfdH0RBN1rIQmpe2NvmBy8ZZG/JfrVKsaDTnFMvt+zC4AISi6DNH +A8VsiWAKdkITt7LiCWAoulv/fh2WaGVmKP9b8wNLdAvRguyiWOXZ5S/0Ex7OKqDySAk jwibtW3ZKuqmPt/anSVDO58PTpVtAq4CDyfajvNP1TMv8/DRI00kgDT+vMo8keDKXhqU GgFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EKzG24Ov; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j18-20020ac85f92000000b003b8685dfa2bsi9474770qta.386.2023.03.06.23.14.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Mar 2023 23:14:27 -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=@redhat.com header.s=mimecast20190719 header.b=EKzG24Ov; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZRU4-0006HU-6g; Tue, 07 Mar 2023 02:11:40 -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 1pZRTm-0005mg-Ah for qemu-devel@nongnu.org; Tue, 07 Mar 2023 02:11:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZRTg-0005sM-JM for qemu-devel@nongnu.org; Tue, 07 Mar 2023 02:11:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678173076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=upOlGMHWjHNNBfJuoRRwinF5pbnBznfwUp5wdi6JWFY=; b=EKzG24Ov5DaTFy2RIJrpm24K98V4vZA9VzBjSiYE3UWvB3Lx+61waRNcVqUxoJbEPHUfoN 7RjQ1tWDehj5FvVuj7Vjd2i0WLy20hJXfOHYyMXOnjvMeWdYFhtOAZpr9qcACEzpqRFzcs NBY7vwP7ka/yoPXSa+MfEKYgwWflag4= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-WmsibDdYMnGDBr5Glnqfww-1; Tue, 07 Mar 2023 02:11:12 -0500 X-MC-Unique: WmsibDdYMnGDBr5Glnqfww-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 292002808E60; Tue, 7 Mar 2023 07:11:12 +0000 (UTC) Received: from localhost.localdomain (ovpn-12-78.pek2.redhat.com [10.72.12.78]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3977340C10FA; Tue, 7 Mar 2023 07:11:09 +0000 (UTC) From: Jason Wang To: qemu-devel@nongnu.org, peter.maydell@linaro.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jason Wang Subject: [PULL 47/51] hw/net/eepro100: Convert reset handler to DeviceReset Date: Tue, 7 Mar 2023 15:08:12 +0800 Message-Id: <20230307070816.34833-48-jasowang@redhat.com> In-Reply-To: <20230307070816.34833-1-jasowang@redhat.com> References: <20230307070816.34833-1-jasowang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass client-ip=170.10.129.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Jason Wang --- hw/net/eepro100.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 4b5d455..722fb55 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -486,8 +486,9 @@ static void eepro100_fcp_interrupt(EEPRO100State * s) } #endif -static void e100_pci_reset(EEPRO100State *s, Error **errp) +static void e100_pci_reset(DeviceState *dev) { + EEPRO100State *s = EEPRO100(dev); E100PCIDeviceInfo *info = eepro100_get_class(s); uint32_t device = s->device; uint8_t *pci_conf = s->dev.config; @@ -1847,18 +1848,11 @@ static void e100_nic_realize(PCIDevice *pci_dev, Error **errp) { EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev); E100PCIDeviceInfo *info = eepro100_get_class(s); - Error *local_err = NULL; TRACE(OTHER, logout("\n")); s->device = info->device; - e100_pci_reset(s, &local_err); - if (local_err) { - error_propagate(errp, local_err); - return; - } - /* Add 64 * 2 EEPROM. i82557 and i82558 support a 64 word EEPROM, * i82559 and later support 64 or 256 word EEPROM. */ s->eeprom = eeprom93xx_new(&pci_dev->qdev, EEPROM_SIZE); @@ -2076,6 +2070,7 @@ static void eepro100_base_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); device_class_set_props(dc, e100_properties); + dc->reset = e100_pci_reset; k->vendor_id = PCI_VENDOR_ID_INTEL; k->class_id = PCI_CLASS_NETWORK_ETHERNET; k->romfile = "pxe-eepro100.rom";