From patchwork Mon Jan 9 09:26:11 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: 640599 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp2040951pvb; Mon, 9 Jan 2023 01:32:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtfvAKNdArdQi4qV7B6yJKZinNgOAUIHBA7McCabZQ6S+xgOhEfHom9V6GWJ2dhWvv8VmqO X-Received: by 2002:ac8:41d4:0:b0:3a5:402:4bcf with SMTP id o20-20020ac841d4000000b003a504024bcfmr89294869qtm.24.1673256741562; Mon, 09 Jan 2023 01:32:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673256741; cv=none; d=google.com; s=arc-20160816; b=BdoEXlVHcWH4jd1eZdk1/sqT6XoGIfed0pcPhU9X0Pr6WK2694NbqQhwJmGdz0B05j x8ZV1Y+L1QJKucls36PBsso2s2Q8OxIQ5EvvmJoBNwdkkxXjY0V9uWp0a8/GnLFU+FcP 00apD2pc0rbEgI+eViwpXk9Jyz6prVssU8jzJbC3hWKvJQ+MvFrgaADEpUMBLjcKXTUK xkz6Fek92zgZjAu9jxSmcoAJph6fKpm5L/Q4XT034lmJBfo7cbcnV9X067Mb6PS4zQLr 0u3+Of09L1e8ijPU+vcLnGM78CegWv5iesvVw2CzswDEwZE0lGDH+hX0C2cWzfFfAgxZ p3qQ== 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=jEosG62QqV+HBGOoLpBswQWoIE4x1xnJ0kp5ZqQ3kHc=; b=ITBqA/wI897Xm4qqEf7fAsYRhjjyL/TvTtQh16fvizEXJIt4swFICpdhE5CiI5hi0N 9Rrix/3N3xqKTICDSiy6AzXoyePsPHrHxYq8uH69iFxla5qO/Ut9dBsHNKniZcdZGRcV TS8Rs3eUPIGmNm6h9vuANj6BL3jkWVj6RPxLQ4yVwfXB5ssnmtseOcZaQHPtfyimM/9N 1Hr8ANMoCYC4+XKGzMdHsWzJdmLUP0mrlpPpLAuoyUO6LZib8b0aY6+b033zit4Fp0Dl EvrP2qZ9s6bxRABzWWMIVMsud+mEAbSZL2N+5rBblV9qI4fI63/8BwJksXcL6YgkL0x8 fJLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="GM4rptv/"; 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 k1-20020a05620a414100b006e043ac205asi4796267qko.744.2023.01.09.01.32.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2023 01:32:21 -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="GM4rptv/"; 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 1pEoQe-0003xW-GO; Mon, 09 Jan 2023 04:26:53 -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 1pEoQQ-0003vu-3i for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:26:39 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEoQO-0005SV-G1 for qemu-devel@nongnu.org; Mon, 09 Jan 2023 04:26:37 -0500 Received: by mail-wr1-x42a.google.com with SMTP id z5so6426977wrt.6 for ; Mon, 09 Jan 2023 01:26:36 -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=jEosG62QqV+HBGOoLpBswQWoIE4x1xnJ0kp5ZqQ3kHc=; b=GM4rptv/Zy5qFueRB3X5lfufJMT/hHb4Zs9FBJNt3ChugeM4YqTBv2Y2TAxKdFKpjs xMO9PHH96w4K7YvCTwBiV/C9ECXXurCmNbz1Y6qg/Q/4lpgswoZX028K7k1LVf+ucUj8 HBfgEldTbeJCYjmeBVizGjQyRq8OSLlLcvvJLlsFd1wABaGtol1ZU0TVbTE0YSElkd2m PrhfVtW99WA+Vgr1D0XiH+CkSyNdrP+sZv4MKRU7BfKUh/0yO2IuLivf7y2xhPopmKb5 LQpwg8p+EAVu9IWvkebZiEeqTmhligv6qnnIkmj8/BlpElbeApFIippWhgQOAXwcHTOp BRDQ== 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=jEosG62QqV+HBGOoLpBswQWoIE4x1xnJ0kp5ZqQ3kHc=; b=AMnt3YQP3FwZBjlfNMuHzhA91MzwU/2JU6yOhWXFv3KqqNHtVzfSMY8fJ7zgddBCrG 1CUyMDnpHrXiT1K/YNvHrbLSdc6We6i/o2Ai+NCkmWzp6K9WY6eaVCAhq+6ujQck1x5b zgVpsyk9aviL0IHb+BRByjy5jb0LhiHvRGa12wwuRMdShTjmSMDgYd+vq0mWb1fDYcYG k3sWDKyyB09+edqXUCVvgn0YHumTd4l63xCeio/tnjUKnHufClPqDqqnnmM/obrW+OML 9B9HsrXv/TEG0VNR/gaFHr6HZMBajGHr3Th2RAK/+xfRfxjxKjDFAWEbwqp3A1mxclDT GTvQ== X-Gm-Message-State: AFqh2krX2HwqwvHozLvFGPXLV8cw9NMqlbs3E/XoTAwmhzsGk6cKEVt3 pAyeVUHfakBwJ6Cn7oEFxYk9IfGgK7pW8m4a X-Received: by 2002:adf:f285:0:b0:270:57d:d1c9 with SMTP id k5-20020adff285000000b00270057dd1c9mr37988708wro.39.1673256394935; Mon, 09 Jan 2023 01:26:34 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i10-20020adff30a000000b0024228b0b932sm9622766wro.27.2023.01.09.01.26.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 09 Jan 2023 01:26:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Jan Kiszka , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Michael S. Tsirkin" , qemu-arm@nongnu.org, Eduardo Habkost , Markus Armbruster , Richard Henderson , Peter Maydell , Thomas Huth , Marcel Apfelbaum , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] hw/i2c/bitbang_i2c: Convert TYPE_GPIO_I2C from SysBus to QDev Date: Mon, 9 Jan 2023 10:26:11 +0100 Message-Id: <20230109092617.80224-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230109092617.80224-1-philmd@linaro.org> References: <20230109092617.80224-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 Nothing in TYPE_GPIO_I2C access the SysBus API, convert it to a plain QDev. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/musicpal.c | 2 +- hw/i2c/bitbang_i2c.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 23359a6ac3..13f4dbdbc3 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1297,7 +1297,7 @@ static void musicpal_init(MachineState *machine) dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE, qdev_get_gpio_in(pic, MP_GPIO_IRQ)); - i2c_dev = sysbus_create_simple(TYPE_GPIO_I2C, -1, NULL); + i2c_dev = qdev_create_simple(TYPE_GPIO_I2C, &error_fatal); i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c"); lcd_dev = sysbus_create_simple(TYPE_MUSICPAL_LCD, MP_LCD_BASE, NULL); diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index ffc5b95410..58503f2b27 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -13,7 +13,6 @@ #include "qemu/osdep.h" #include "hw/irq.h" #include "hw/i2c/bitbang_i2c.h" -#include "hw/sysbus.h" #include "qemu/module.h" #include "qom/object.h" #include "trace.h" @@ -191,7 +190,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(GPIOI2CState, GPIO_I2C) struct GPIOI2CState { /*< private >*/ - SysBusDevice parent_obj; + DeviceState parent_obj; /*< public >*/ bitbang_i2c_interface bitbang; @@ -233,7 +232,7 @@ static void gpio_i2c_class_init(ObjectClass *klass, void *data) static const TypeInfo gpio_i2c_info = { .name = TYPE_GPIO_I2C, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DEVICE, .instance_size = sizeof(GPIOI2CState), .instance_init = gpio_i2c_init, .class_init = gpio_i2c_class_init,