From patchwork Fri Feb 16 11:02:57 2024 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: 773312 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285940wre; Fri, 16 Feb 2024 03:05:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVI9wNbBMumbEfqgh6TgiptHDlAzfrv8FegNVlZmJ7CY6h28BwquDlx+kXeAM99WXI/lKl2uxy9VhVr++4bjBJE X-Google-Smtp-Source: AGHT+IHjSUixBU1GI0IDd4TFYn8q0Ve6GCXspt4tyQvBaKdmzswg77Llggjm/AyEXCcv2JfiI4im X-Received: by 2002:a0c:f0ce:0:b0:68e:f0ad:93f2 with SMTP id d14-20020a0cf0ce000000b0068ef0ad93f2mr4553647qvl.19.1708081537997; Fri, 16 Feb 2024 03:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081537; cv=none; d=google.com; s=arc-20160816; b=FMa4r69oXLpRxYkmXwLfVWfWb26VZ3XDsHNOGjM09WSfIAHf06D91Ji11aTL3zmr/z Iv0brmA1cuKKaBp1TvNXLn7ua4W2WCTuvrhtmeli108MmoEIHO3VB26TldmPPqKgbq7x r1TimdnAOs6UDeFe/4jQN7uNnwyvhV7wsHePNxvK/hqUSjZKyy2SOogzhmdz9fr4idP9 Q6fXmX4ZWy2d/G/SusLoardOl1VfH8md74CaEoFru3vBMGLkMaeBo21nybUPCuYJ8imm MrEQOzp2jSJICXOPhSYXSGx5/qClkdd/LaXelB38s21Mp4dgyWryskgyF9RABPfWKaML A2uA== 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=jyHSiP+USy9LLsFpR2fD5RYQ//7L3lzistxQTGbBMcU=; fh=mFnen777txzR4qYJX4RargeSoe8/T845RMRdgI5rRv8=; b=Ro/DSG8T9pMc13phPepjbrPH3LzFOQbQAeheINYspjdFNVzDIeUyhO+ckRaxH0UmDk kcb8moflungNKUD52XtqsPwheTitlrJ1qt1LtYUT3LUhsIjxNbD6ZjIJnC6LTGVrPtiX 7u8nCGr9n7WVcYdwkPwaI/NVOF7hy7ZKNzhzEHx9oLzhMhG3iwSDvgdl4hSW42W4aZ9u CYrLQD1DSCtgh+mBZKWolStz4bqgLopmP6jepfRp4EgAXl2siPXFZNzLIYzzmB4DfooI sNJxmUmZE8l9smbQ2oTE7JFGaxdO4jz/oZeAYSp1gHGjQpa/KIbxONENTxpo3H3Oa6HR j3VA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tI5dWdyK; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 8-20020a0562140d6800b0068f2eed8e0esi1821819qvs.287.2024.02.16.03.05.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:05:37 -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=tI5dWdyK; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raw0f-0006a4-Ga; Fri, 16 Feb 2024 06:04:01 -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 1raw0d-0006YK-MG for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:59 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw0b-0000wX-E6 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:59 -0500 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d0b4ea773eso23787391fa.0 for ; Fri, 16 Feb 2024 03:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081435; x=1708686235; 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=jyHSiP+USy9LLsFpR2fD5RYQ//7L3lzistxQTGbBMcU=; b=tI5dWdyKBhFtIOXg5uWn8++EdwkI9bV/ShkHlbHXcI8QS0TYyvoSc41cti49Wvdft9 K+PTrFwaaRGWQ1R24NTKTx1s4vFvhm68JwaV7uH22nfGyqTdl19qEx4ys8R/WbUR6Z7C 8HuEIsw8JZaf+xJpPO+2k3/ltziAMVqwcZQxJpE+gcdDxNshmWTAXpN49aqYkwN3Syjb zs9k87MnMfIw2zB9/HGkQwQ+PCziC3QwCY5ZJeUVK8QM8Uz4LyPkROMlslodrt5mrw3k 9soYk769Y4j4N5EzhghvOl1GUN954L3lb1Jrv6E6uRpOdr1YAVLfwmwgQF9bq3I4nAAT 7smQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081435; x=1708686235; 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=jyHSiP+USy9LLsFpR2fD5RYQ//7L3lzistxQTGbBMcU=; b=s/Bf3AcZLW1DWh4c5oxv7qu67R6aK4Qe+nvrZpPrk0jWlYI3sdE5d9WSSc7pIDYid7 7S7re9ekdqn7sRD43ldVU9F7+lryKK3+sQ4cchR6h5TRJA/77LYDAj5n/pVs9j/bpHnA G6lUU+/n67uwmhSSKDVqRWdvSCbn3nTwpVx25f4Csg29Sq7L9caWsSJ9xYrnnpHMCaAT fDNsWYkIB+r6GZuLcd5zrEKmtR6KPJhQsmJfDzIMjx+DB9/yiRhI4M5y4aIN1055GVHV ztl72KxsVZTrobXVcTIBNR9ptDZJFdGtpRbc6/HDZrmLCBIK7wUGw8y1E+0T9VeEUf61 Xo2g== X-Gm-Message-State: AOJu0YwsYdSPPAGtv49wIzm3Vp3nXsMSo2sZdQmapoISHeLxZuUu1T1H Sypcv4bZN4VdPrTNuZIIdVBi1ITXfidV/MK7+8IGJV5BmyY9+HFZmi49hR4PS77lF/cc2UE6wkU O X-Received: by 2002:a2e:8911:0:b0:2d2:12d8:42a5 with SMTP id d17-20020a2e8911000000b002d212d842a5mr1692149lji.7.1708081435334; Fri, 16 Feb 2024 03:03:55 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id bk30-20020a0560001d9e00b0033cddadde6esm1920641wrb.80.2024.02.16.03.03.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jan Kiszka , Peter Maydell , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 06/21] hw: Replace DEVICE(object_new) -> qdev_new() Date: Fri, 16 Feb 2024 12:02:57 +0100 Message-ID: <20240216110313.17039-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.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=unavailable 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/arm/musicpal.c | 2 +- hw/core/qdev.c | 2 +- hw/sparc/sun4m.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 2020f73a57..74e4d24aab 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1238,7 +1238,7 @@ static void musicpal_init(MachineState *machine) qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL); /* Logically OR both UART IRQs together */ - uart_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + uart_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(uart_orgate, NULL, &error_fatal); qdev_connect_gpio_out(uart_orgate, 0, diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c68d0f7c51..a271380d20 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -171,7 +171,7 @@ DeviceState *qdev_try_new(const char *name) if (!module_object_class_by_name(name)) { return NULL; } - return DEVICE(object_new(name)); + return qdev_new(name); } static QTAILQ_HEAD(, DeviceListener) device_listeners diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index d52e6a7213..fedc4b8b3f 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -979,7 +979,7 @@ static void sun4m_hw_init(MachineState *machine) sysbus_mmio_map(s, 0, hwdef->ms_kb_base); /* Logically OR both its IRQs together */ - ms_kb_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + ms_kb_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(ms_kb_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(ms_kb_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(ms_kb_orgate, 0)); @@ -1000,7 +1000,7 @@ static void sun4m_hw_init(MachineState *machine) sysbus_mmio_map(s, 0, hwdef->serial_base); /* Logically OR both its IRQs together */ - serial_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + serial_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(serial_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(serial_orgate, NULL, &error_fatal);