From patchwork Fri Jan 24 17:50:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 859634 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp921607wrq; Fri, 24 Jan 2025 09:51:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUgKR990F/158GxeDIuAHBqYfnMYQNHn4x7snfNwVGuzb2gf72eiNfJKbhiUFiVc16Cp64+Fg==@linaro.org X-Google-Smtp-Source: AGHT+IF1s5ZrEGYa05UR8UifP20YMeDveeP6U7U1mbFXwAyiuNO5RpweIGpN1G40BkGvhQ2yfqlv X-Received: by 2002:a05:620a:2449:b0:7b6:d1f6:3df with SMTP id af79cd13be357-7be632023ffmr4806649285a.21.1737741080054; Fri, 24 Jan 2025 09:51:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737741080; cv=none; d=google.com; s=arc-20240605; b=FhzR6MJDr9bgYE+GRvNG+lxntfyDsjavz2jh3ET4hbxv1tBz2DFrq8+WRo4xnEVjFc FnCIew6WAQ2pGdPrHfFw1st6kJHLjmAcVVGKrcz2XqqmV0pkwHbcatC2MhSO/uAm7Fo0 G/7FyxocPR81W93sY4MO+ofA96KD+uF9NJ/BFSeKjIAreGvNltNpUj2dwyERfuB7T+E9 2GdO2G2527m4/r2G8fB8ialWl7hzR1Zh2hjLnXZqe3E7eeCGG7G6jUfKhZRR/sK+YWhv 6elMwIWZfpaVI6vI0pSP0SkLV8DGoRm2LMDOpE4pD8g5Jyc9Ws05GDYiTLpY/SnqxVzK 0o3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=se+/ei82uiUe3GOlyYsBHGJGXnKSrED8GmHFVnOMzmw=; fh=Clhsa153dQJOYJnJkkACrZqwYRmLQxDoUVoK+Furpss=; b=artRu7d8Sc/3E1yvP+hNkulVVaoRMszg7rnPggHuxzMon+2zMa6tuo89jBXXmEXQNF XYlu/QN+g69BdtsMwuruHaTZeHOwpLRY64YrwM/iiCF3Mlg8ut84chVJixT4BbGAkH8g eLTmROBdp/iHIUm4zTrb8Aqmjk/iFczgcszLld1spVJkb6bXjQqfM/tnhk35OMFWkb3o SYo+uDu73+Ds5JQtZ5160e2+kKUEydrNCu1mIOQKZsinbMXUbHsux4oOrUcee4IiokRT LhwEQeYwRHy+D2qBIDJdPV7KUII5k1uAfzzgLdYPIDKT90UUMcyDDkrSXYJHDRquJJ8t J2Rg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tgvq851R; 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=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be9af12574si283769885a.512.2025.01.24.09.51.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Jan 2025 09:51:20 -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=@linaro.org header.s=google header.b=Tgvq851R; 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=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbNpk-0002J2-7h; Fri, 24 Jan 2025 12:51:09 -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 1tbNpf-0002Cu-V7 for qemu-devel@nongnu.org; Fri, 24 Jan 2025 12:51:04 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbNpe-0004Rd-A0 for qemu-devel@nongnu.org; Fri, 24 Jan 2025 12:51:03 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43635796b48so16027875e9.0 for ; Fri, 24 Jan 2025 09:51:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737741060; x=1738345860; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=se+/ei82uiUe3GOlyYsBHGJGXnKSrED8GmHFVnOMzmw=; b=Tgvq851RS0qlZ60dn/wJLgUauJ4TKUoaI6j0fBttP5y1g4HZbqwygxd/vpaaHovK8B MlJzR8aakz/dG/Zp3/UGMB3/8KmaPyScWjF7x/7GJZnEsKlRdSYl08dqacywmlcmTXz2 hlAkevEfjqONWn6kIELTuFTVjCOMhWk0R/RhCmq54spWqFRlxtWzYVjgg+DqxZb8y5Fk uryT6qfw9qkRYwk0MZ/kSWoIVZeTLa1I12dn0WK26e/gcVJRCHvSeXGD2/VF/d2ri1jc 3Xe+iQGunMmuVfy8dpaXVXYiYs9yKPeJV5huJfRbUuGtlXhUfaliWYf1Kw+fObpyYJZj UTjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737741060; x=1738345860; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=se+/ei82uiUe3GOlyYsBHGJGXnKSrED8GmHFVnOMzmw=; b=osNyRYd0uufAUFq+XdzhB4/a5iv2Y2fyiRABfOpxP04YepnHxcU/cf3HbIfJuRiQ8y Q9qm9wChIoEMcGZbHph66IbalEnwEZI/I0E/ViYs0wrDJfnWRVMjUOBOKpIZGcc0N9Xk tNgdNqbfKSfScCj8zJFaTX8SjAtGtWa9SXMKf9bqNqwcaWOyGY7JvZRao5UmsSHUQVtY vTL98StpIiLqJ0it3Oqs/5ZYV0/bJm6B0KRsQLuDBkA6ppkgc4FANhyHu+6gmauefaG2 UTtM7ofK6kNaJH90ZOJoTLr1NBbzVnB4vfwqOxGg5pmHevCyHW4Nn1z23XzWnv01sqMZ 1rlQ== X-Gm-Message-State: AOJu0Yy3XcGfME/hEa6xoNh9nxFpEHwjUf9xVDB4VugONfYSpTbYIbHZ 0XlySuXEWFvkSJjvRxpdZLDSz/lxoZnHKvKDqTlKf2PPVyeISeMz7t4rLua99uC+sgRoIIhwni2 ERbA= X-Gm-Gg: ASbGncuOZHPoC5d/D8cx7BXpeXHxjB/sTgXpjMw+F6LgQnxBGE0eCUxf1UMTXRC4JoV G1LZGdy1xJimCBiBWHiAceS4opL6ct+o8s0gv18axMproaIoF+Y+eb49eXG8ep92KtT07a2LMul VFX1EQ+wQ44MBIUoR5MxuUFhiXW1mV09wy8fU4E4uRSGhjOUFhj3wWe9YyYbnI0cIk08urQrJwt yx/niDrZhtNSnM92NfUF3NhZ0QaLZQ8mKNNQv/dZyTAgEvkoKrM3RMRspiTjfBoWxHSgzYGJSun XAnSze7imhdnvmOK5UOFK7D4QY9SCIdDlhmt/KDWvW6cVI86rEDZZpQ= X-Received: by 2002:a7b:cbce:0:b0:436:1af3:5b13 with SMTP id 5b1f17b1804b1-438bd0bd2edmr41981755e9.15.1737741060169; Fri, 24 Jan 2025 09:51:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd48a906sm35858865e9.18.2025.01.24.09.50.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 24 Jan 2025 09:50:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Bernhard Beschow , Magnus Damm , Yoshinori Sato , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PATCH 1/2] hw/char/sh_serial: Delete fifo_timeout_timer in DeviceUnrealize Date: Fri, 24 Jan 2025 18:50:52 +0100 Message-ID: <20250124175053.74461-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250124175053.74461-1-philmd@linaro.org> References: <20250124175053.74461-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 fifo_timeout_timer is created in the DeviceRealize handler, not in the instance_init one. For parity, delete it in DeviceUnrealize, rather than instance_finalize. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sh_serial.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 247aeb071ac..29ac9f9e5e7 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -436,9 +436,9 @@ static void sh_serial_realize(DeviceState *d, Error **errp) s->etu = NANOSECONDS_PER_SECOND / 9600; } -static void sh_serial_finalize(Object *obj) +static void sh_serial_unrealize(DeviceState *dev) { - SHSerialState *s = SH_SERIAL(obj); + SHSerialState *s = SH_SERIAL(dev); timer_del(&s->fifo_timeout_timer); } @@ -447,6 +447,10 @@ static void sh_serial_init(Object *obj) { } +static void sh_serial_finalize(Object *obj) +{ +} + static const Property sh_serial_properties[] = { DEFINE_PROP_CHR("chardev", SHSerialState, chr), DEFINE_PROP_UINT8("features", SHSerialState, feat, 0), @@ -458,6 +462,7 @@ static void sh_serial_class_init(ObjectClass *oc, void *data) device_class_set_props(dc, sh_serial_properties); dc->realize = sh_serial_realize; + dc->unrealize = sh_serial_unrealize; device_class_set_legacy_reset(dc, sh_serial_reset); /* Reason: part of SuperH CPU/SoC, needs to be wired up */ dc->user_creatable = false; From patchwork Fri Jan 24 17:50:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 859636 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp921675wrq; Fri, 24 Jan 2025 09:51:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWcSy84Pz899APJhY0vBSKDRSb5NXGUglQAmEzz2U7P7BlpTz4ibj217zQkr8oJDIKevKhBJQ==@linaro.org X-Google-Smtp-Source: AGHT+IHxIn+CQd2IKKztJlL4Yfgjadd1+e9h/+BuUQrGKE1Mr7aSShAeinVOBO+LAXRO9y/Cf7vO X-Received: by 2002:a05:620a:3950:b0:7b6:d58b:9dce with SMTP id af79cd13be357-7be63288566mr4150964685a.51.1737741089648; Fri, 24 Jan 2025 09:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737741089; cv=none; d=google.com; s=arc-20240605; b=fCmNAwPCI6e6gimwtML40Wnx0ABZ3Jlr8Ux9aRkXK9f9PFyNOxYuIN0m20ISge1d92 9n0opgdRm7oq9Dhd7HylRocCUBZlvoZzMMmZugUpoPIML/uOC+iWNza/IOCINvW6aMb8 rzqGublxF8VvTWPcglmc9251so9Kwp/Ivktb8DGqYMJ/+mzgXYFd3CyinmLP2FTUoyhJ 1DcOQizrOJ7mAGCg8+eZjyD6I/71+qtXQyqV3ZLiY4r6LYHvxm5ou/rKON3uq00nTuyS mCVKickO+ELo71eesYUMeYXa6EEWXLRk4z4C4n8AVyWrEEj3LLPrIUxienDnbNY/2JMn JQ+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=rT1MOuQ+ROxukrI9hyYFsi6/FYVxGe6kUzeG59TN43o=; fh=Clhsa153dQJOYJnJkkACrZqwYRmLQxDoUVoK+Furpss=; b=aUlxiTaKzxj3jwqCzClz8w9awmFg+IT11I/mB83lp8wAaBT4BKIQsJwApTb9TJE8er 2+08+j+OEQ3GQg5MghrXh7bI1Ts3ub3rfczvqXnCxlRD6Yq0rr1BoTSfw3TmCxjgtC9M hfXOJk3w+85mSJc19JBD7MT6QvqvgBCKZ+N9P/oLRDcsmv8iBhKGurAFQAL/dIibEua0 TVwhFm9LS0KKJG9c+gRqmyF1BykrDCv+/snc6b1rDRHIC1ulkNwDEQ3VMoudoL8UxbyM J5qNH98OrZ27WdGonsaOuVWxcA3UKuhnaYYpzeX2v6ZIQ8BxjcCNUEoWEYaJWrA6RjXJ rIvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mP1kDJlc; 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=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be9aee10f0si275575785a.227.2025.01.24.09.51.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Jan 2025 09:51:29 -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=@linaro.org header.s=google header.b=mP1kDJlc; 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=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbNpo-0002ap-8T; Fri, 24 Jan 2025 12:51:12 -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 1tbNpl-0002PQ-T0 for qemu-devel@nongnu.org; Fri, 24 Jan 2025 12:51:10 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbNpk-0004S4-De for qemu-devel@nongnu.org; Fri, 24 Jan 2025 12:51:09 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3863494591bso1319739f8f.1 for ; Fri, 24 Jan 2025 09:51:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737741065; x=1738345865; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rT1MOuQ+ROxukrI9hyYFsi6/FYVxGe6kUzeG59TN43o=; b=mP1kDJlcyX3PToWKL1JVhPehpP+k5sJ+yDKW9JIUlaL5XRZezq9DzlFBrRopgYHGQr xBeV6dNc9r1sxJ7G3qdj6oeNljvDBqpqA8Am+JNn8Mhh6tTyPP5zGvxrTXyeOHyQaBQQ i7Ls7PM/qvgXiuQj/Ri3EIfjJYo8IGBmRhCSk3wtYWRFmDG+nb4t2EwJeiqt+z7Xa2WV t/Kv68h9FXH6JqkOwhwzxac6lDC0ImHUFPCiyTynZK7fllrqRO2wpwzlZp/Jd5Hc21B1 WvUbViz1nLvDx3vkrSKK+8MOXvyBZ99vn/tXgygeWzDGO3ooyhKBkIxJ8/6e2AsLxKhq szng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737741065; x=1738345865; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rT1MOuQ+ROxukrI9hyYFsi6/FYVxGe6kUzeG59TN43o=; b=MDjR3xTCqcFdLq2oOad7pMjw0BF6kPYRt+6D31QQdtxVN/o+pVglZ/EmZYCn+25ntk VxLZHH/7nZf2PghXl1ROswnthF8yASOCKsmSOyDdAz9FbQyIjdg3G0IfMqM+BCx9YnwP AUKnfAtwVvIguP5SbCn8SBAb5XmqXyTWvjHu8bGXmr2cm6MmB3Y5fNtKpBRrytMK1DKE CILz2GqHVAUUyUvt7ei61lP+otL2OuLKTd59VSEy7sWROxGOC/8Y4ff38HyTKum/FqzH jWkqkmDZxSqbdZ/n4ccO7Ea4Ubu1kmmqN9dw4XaBD+s+o8/th47M6HS84vvuAPX8iDbO TXxg== X-Gm-Message-State: AOJu0YxOhEfPiF/sgVMvU25HhOfO51krYqtATZoe09pTm2EgJ6ZAbpCe vPqCj0JdxRYWRhSR7NV52lvP5GaolvJGNMkBXVgAwwNcehgXtMiYF3SbtYEbfzb7v+8D/MIDsDn n/9Q= X-Gm-Gg: ASbGncskBpQ8n/sF9v1VjHMoaksEI1ETkWKULPlh0dLa2estRZX5sdBHEHBsha0OhM9 pzkTVIAZ5Jl0fkl/lfCHVJj/ObHK3XKqBu0oa407MrYjy73PHil/wO1Tj21N96k1UrPNFuyUigC 6ly4q1n+/jFHr57k7+G9fX031hDq+216DFa+VCehuEBu8KRmKN11BLUzOw66gNvrSLCnGZ/6yxK QLaWtjjOhOxkOUSYsX4Qz6SOwM2mC2LbspdwZt9Zdz+9aq0debmvEVn/7n7+lDXpG1l+oA2NWdN Yp4xJ46attNoR9sxJPRerc6UpSNWmfcqXrhzURkocS7CyDD1N1Zwsag= X-Received: by 2002:a05:6000:4025:b0:38a:36a5:ff81 with SMTP id ffacd0b85a97d-38bf59e254bmr30134847f8f.40.1737741064841; Fri, 24 Jan 2025 09:51:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1764b7sm3392126f8f.10.2025.01.24.09.51.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 24 Jan 2025 09:51:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Paolo Bonzini , Bernhard Beschow , Magnus Damm , Yoshinori Sato , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= Subject: [PATCH 2/2] hw/char/sh_serial: Convert to TypeInfo Date: Fri, 24 Jan 2025 18:50:53 +0100 Message-ID: <20250124175053.74461-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250124175053.74461-1-philmd@linaro.org> References: <20250124175053.74461-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 QOM types are now registered using as TypeInfo via DEFINE_TYPES() or type_init(). Update TYPE_SH_SERIAL, removing the empty QOM instance_init/finalize handlers. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sh_serial.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 29ac9f9e5e7..b1db91656fe 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -78,10 +78,6 @@ struct SHSerialState { qemu_irq bri; }; -typedef struct {} SHSerialStateClass; - -OBJECT_DEFINE_TYPE(SHSerialState, sh_serial, SH_SERIAL, SYS_BUS_DEVICE) - static void sh_serial_clear_fifo(SHSerialState *s) { memset(s->rx_fifo, 0, SH_RX_FIFO_LENGTH); @@ -443,14 +439,6 @@ static void sh_serial_unrealize(DeviceState *dev) timer_del(&s->fifo_timeout_timer); } -static void sh_serial_init(Object *obj) -{ -} - -static void sh_serial_finalize(Object *obj) -{ -} - static const Property sh_serial_properties[] = { DEFINE_PROP_CHR("chardev", SHSerialState, chr), DEFINE_PROP_UINT8("features", SHSerialState, feat, 0), @@ -467,3 +455,14 @@ static void sh_serial_class_init(ObjectClass *oc, void *data) /* Reason: part of SuperH CPU/SoC, needs to be wired up */ dc->user_creatable = false; } + +static const TypeInfo sh_serial_types[] = { + { + .name = TYPE_SH_SERIAL, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(SHSerialState), + .class_init = sh_serial_class_init, + }, +}; + +DEFINE_TYPES(sh_serial_types)