From patchwork Fri Feb 3 21:16:20 2023 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: 650110 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp1056916pva; Fri, 3 Feb 2023 13:17:37 -0800 (PST) X-Google-Smtp-Source: AK7set+FJfDs/920xZCbvSIEVcrutG330Fy30w3dCT9kx0mJ8iBfUbcJD4PBDMghLvTeGuDthlgG X-Received: by 2002:a05:6214:5442:b0:537:6bc5:6c3b with SMTP id kz2-20020a056214544200b005376bc56c3bmr20117242qvb.30.1675459056900; Fri, 03 Feb 2023 13:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675459056; cv=none; d=google.com; s=arc-20160816; b=QoonO2ZTxrwsoF9ZR6Q4dQa2ZjlWiOT37ONzR05UhHKGfpTU2zi/maWrBDBOYmGCLQ 4MffXpwiKiQGc9MoKZBStzNpOyALsp+EVRQAjUS5nLL+mjuBZ0spXXv6x2WgN47T4gpY Crlbpk0oPC6XHbTQyTfDioN2hayEjUFoMNLVwb6rNRW6ghryRyeG+hPRQPVH6cFK/iyH 86C3DvLcvKsGPr2iDodv/Moti/X3iCTizuraSXOgEIC07XJkSlk+M5kTIRO6WjMKXt0t lhV6iPOSArxePHkBY5FK94eglZAZBIDnZYqHkyCqdNjpAnfLZiYfvwf+xSG+Hn+OvCMU sZAg== 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=OCe5fq1LEdCOCuZfIaOgrR1H22bGU2FTnkvkdNk/zEU=; b=fnxY9OhZOiCgERrk8127CIaMU9o4/NewDYgxA4wA5U2Dxvncr5IdJKBj0aiIQlYN6O zUsXn1tPez3QXNleBjHJEoHSNBCmJ/IMxQoitjUOKuNK47CZsoFZdOMKlmlWSL9ygip5 E6I5MNjri8drh5caMSV6mzaM8ZACwYbynR4+DhC4r9KIUsi1ZO9eGEVylSSfjz6dy+Yl 6MXSAo8IkIeB1cGlA/+yIsWWGb3AJFuZJCne5tcW00RqKC/iy4v4KhVMj+W2/D0w53Hl 0kKjs1nTrAlH4U5xnqm4KND2/RHv7RwGOXcB6/7b3eqrRnvrRo6k6KQgIZ8f2uqfaSVn Q1fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sga5CwGk; 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 jo30-20020a056214501e00b00567d83e15ddsi2642345qvb.232.2023.02.03.13.17.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 13:17:36 -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=sga5CwGk; 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 1pO3Qc-0000LT-Po; Fri, 03 Feb 2023 16:17:02 -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 1pO3QM-0000F8-Ci for qemu-devel@nongnu.org; Fri, 03 Feb 2023 16:16:56 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO3QJ-0006Cn-62 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 16:16:45 -0500 Received: by mail-ed1-x535.google.com with SMTP id u21so6424127edv.3 for ; Fri, 03 Feb 2023 13:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=OCe5fq1LEdCOCuZfIaOgrR1H22bGU2FTnkvkdNk/zEU=; b=sga5CwGkHM9CRvff0crmalFXpNd020JW9AL7+egepLvMqBS4p9D7ETsZ3J7ARDWqgj kR/W2gwiBwLoSy4m9X07vSJtZR9YytVugXFaKF4XLMlQHCVzdmRq6Y/vpE8sIKgpxhna cOWzFiwU83E1juQUF/BzVjkZ2PNyHI/JCGxyRGMO1KPRTMwOexoVR/P6cZ8D3tvxGxOO 9MYI6jCOGS/lOBxvfWY/jryRh17sH/8fvi3wuniuRBfNrPRGsjIPDIzMm779/KBfXNvJ ZufnDod+XFy633X+Cdu7sdy2sdkD5HBrmV7gWb5ERWJ6f8yFlsmBf1LtmOVHJxQf+Lhb tvHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OCe5fq1LEdCOCuZfIaOgrR1H22bGU2FTnkvkdNk/zEU=; b=fVJoq40gvrx2xIAgylMCSaUrBzrw+I8scB5JHY/1ueKW7nc3vIEWm4ySHpENuVUgGs +BmB22d+QOEJ1AdBChCIyxd9bTGmnzihMyyOaei8qVl+6gN/xS6yTwMZ0vBSPnG3ytIi vryjEbWCH8ObNgOOzCQWCfJYscPCPCO2rK9NBWZQrgpgrooXMQU5QKDMIK7cx5J1TA7+ IuDJeAMBJj4QV8N3tXGQDPJe/iu9u5Y92fn6Ta7L6KAkn89HWhZrI+nJmjTBjKzvzfI3 Hkhc5sVvpFrydqt5pXMVQ+NPzV7Q17MANb0TV+vA/WAEjIqZJYBgdPi+3dbdYbSLENYH e2jw== X-Gm-Message-State: AO0yUKWzFU1J96hCZO8gUiwsH3bp2SEPL4r0AN0bA4WgncHLTYQCIr06 TOLMXIS9kCva74AqcPl8QDhAUDhsij7+mq9T X-Received: by 2002:a05:6402:34d6:b0:4a2:2e8a:14cc with SMTP id w22-20020a05640234d600b004a22e8a14ccmr16533258edc.1.1675459001193; Fri, 03 Feb 2023 13:16:41 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id x10-20020a1709060a4a00b00880dbd4b6d4sm1876093ejf.136.2023.02.03.13.16.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 13:16:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Mark Cave-Ayland , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= , Daniel Henrique Barboza , Markus Armbruster , David Gibson , Greg Kurz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] hw/pci-host/raven: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 22:16:20 +0100 Message-Id: <20230203211623.50930-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203211623.50930-1-philmd@linaro.org> References: <20230203211623.50930-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.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 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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. All calls use either errp=&error_fatal or NULL, so converting to the QDev API is almost a no-op (QDev API always uses &error_abort). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza --- hw/pci-host/raven.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index cdfb62ac2e..2c842d2146 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -246,8 +246,7 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp) /* According to PReP specification section 6.1.6 "System Interrupt * Assignments", all PCI interrupts are routed via IRQ 15 */ s->or_irq = OR_IRQ(object_new(TYPE_OR_IRQ)); - object_property_set_int(OBJECT(s->or_irq), "num-lines", PCI_NUM_PINS, - &error_fatal); + qdev_prop_set_uint16(DEVICE(s->or_irq), "num-lines", PCI_NUM_PINS); qdev_realize(DEVICE(s->or_irq), NULL, &error_fatal); sysbus_init_irq(dev, &s->or_irq->out_irq); @@ -319,8 +318,7 @@ static void raven_pcihost_initfn(Object *obj) object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_RAVEN_PCI_DEVICE); pci_dev = DEVICE(&s->pci_dev); - object_property_set_int(OBJECT(&s->pci_dev), "addr", PCI_DEVFN(0, 0), - NULL); + qdev_prop_set_int32(pci_dev, "addr", PCI_DEVFN(0, 0)); qdev_prop_set_bit(pci_dev, "multifunction", false); }