From nobody Mon Feb 9 16:19:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640818338; cv=none; d=zohomail.com; s=zohoarc; b=bbRP6cQ0mInGGKzFN/dOnle+w4RoIArlY9v0D3TqRtR8mz5AYbVWm1TmwhMzLx7KANcGlFaV8WyiUFURDxTS5qshvoP8fUYAMF4HvAAirGATNxCM9Y//+XExs7sdJJ/gi8CCr5+6/gJ14ffqM+UpGJZXMYdp6avli/OAqF/Ue0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640818338; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=e5+ddy+WSkN1x0e4CgeIS+1g9hRe1FYGtrRjE7UXe3I=; b=CcEO4GHf5zK6/Z1fzFo3CqXQnTkmgYP/O4qK/HAcEL1eLAtYiKT9EnCYbhQWa386/R3V3ZvnDdkeLT24K54NZhNAljoXmvFQo0+XqRqh4IBOvVSxiqp7hbx1mmyd8oir/FvUparTZQ6fq6EUPbd60NM8Tek3pD3j/gd6eaTcNOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16408183387791008.3794291157058; Wed, 29 Dec 2021 14:52:18 -0800 (PST) Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-yvbbriWAPci5Nm2adXv_Ig-1; Wed, 29 Dec 2021 17:52:14 -0500 Received: by mail-wr1-f69.google.com with SMTP id c16-20020adfa310000000b001a2349890e1so5396558wrb.0 for ; Wed, 29 Dec 2021 14:52:14 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id y3sm21962630wrq.12.2021.12.29.14.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 14:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640818338; 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=e5+ddy+WSkN1x0e4CgeIS+1g9hRe1FYGtrRjE7UXe3I=; b=NDDuBarhGk5VFmmHnOELeLPw21OTK6LHSxYrB9ribHqY9KtBmAb9DOeSscGF9v03460PWv ZIdYBovbRwacLghE+sfmaxCYtiJSzxacoOijvu2FUdAl4t9Gkq2gLU5ODmYsoJP9fTEHCJ fXxKR7IBOLIpftLiA8wHLcwVu0HaNPI= X-MC-Unique: yvbbriWAPci5Nm2adXv_Ig-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e5+ddy+WSkN1x0e4CgeIS+1g9hRe1FYGtrRjE7UXe3I=; b=j6IUFf0pltKeeKCmoAywpgyS6F9R2XcTyuZYyAoY6ji0m+I4fIJPKx0V6nfaklDhm0 /AXwyQsa97g67/oQTBPXM52Dbk5TTdO41p68C444vrVhW2QUa89TcNfURS4Gh2ERpEbC QWVOcN0xhWOL5DaZ6GiKmlqANgNfbkhyz8VTR6jnZ/k5kQIMXV7PNrfan/LNMlL+s2C9 xv7vUMJVtKpE6dkOtCBVz8JotPXeyYjtGgAh8dM5N9KZ8BnoPmCJZqt05UWOL+CYiFYc rtAfvga0WW92QDbmV2NMcilGovQT/pXo5Wc6DRq2skO6lCnX4fIF2HQjfX5wWI9WH6n3 6snw== X-Gm-Message-State: AOAM533vNVuiyDzh6Sf8TRnh3tx7wL7cpWRJcuyg+SbVFl5NvO90aLpr v40EcAaw5hIM2/f6vlz5SROFVlEWG+o8D3N+jIUM1dzfXk86GSYb0xN+tlqcsUTZWvLsTkExMTh baUbj5f9uy7F6Gw== X-Received: by 2002:a7b:c30e:: with SMTP id k14mr23423866wmj.156.1640818333480; Wed, 29 Dec 2021 14:52:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGgAj5wI9V2CIC5uSc/9zp/z8ESmizqvkVWkzXGtpfuURnXDCNlDWP97EWJdLWZ6dxdSjIfg== X-Received: by 2002:a7b:c30e:: with SMTP id k14mr23423858wmj.156.1640818333323; Wed, 29 Dec 2021 14:52:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yanan Wang , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Peter Maydell , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] hw/qdev: Restrict qdev_get_gpio_out_connector() to qdev-internal.h Date: Wed, 29 Dec 2021 23:52:04 +0100 Message-Id: <20211229225206.171882-2-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211229225206.171882-1-philmd@redhat.com> References: <20211229225206.171882-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640818339898000001 qdev_get_gpio_out_connector() is called by sysbus_get_connected_irq() which is only used by platform-bus.c; restrict it to hw/core/ by adding a local "qdev-internal.h" header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yanan Wang --- hw/core/qdev-internal.h | 15 +++++++++++++++ include/hw/qdev-core.h | 18 ------------------ hw/core/gpio.c | 1 + hw/core/sysbus.c | 1 + 4 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 hw/core/qdev-internal.h diff --git a/hw/core/qdev-internal.h b/hw/core/qdev-internal.h new file mode 100644 index 00000000000..6ec17d0ea70 --- /dev/null +++ b/hw/core/qdev-internal.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * qdev internal helpers + * + * Copyright (c) 2009-2021 QEMU contributors + */ +#ifndef HW_CORE_QDEV_INTERNAL_H +#define HW_CORE_QDEV_INTERNAL_H + +#include "hw/qdev-core.h" + +/* Following functions are only used by the platform-bus subsystem */ +qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, i= nt n); + +#endif /* HW_CORE_QDEV_INTERNAL_H */ diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index d19c9417520..655899654bb 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -532,24 +532,6 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qe= mu_irq pin); void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, qemu_irq input_pin); =20 -/** - * qdev_get_gpio_out_connector: Get the qemu_irq connected to an output GP= IO - * @dev: Device whose output GPIO we are interested in - * @name: Name of the output GPIO array - * @n: Number of the output GPIO line within that array - * - * Returns whatever qemu_irq is currently connected to the specified - * output GPIO line of @dev. This will be NULL if the output GPIO line - * has never been wired up to the anything. Note that the qemu_irq - * returned does not belong to @dev -- it will be the input GPIO or - * IRQ of whichever device the board code has connected up to @dev's - * output GPIO. - * - * You probably don't need to use this function -- it is used only - * by the platform-bus subsystem. - */ -qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, i= nt n); - /** * qdev_intercept_gpio_out: Intercept an existing GPIO connection * @dev: Device to intercept the outbound GPIO line from diff --git a/hw/core/gpio.c b/hw/core/gpio.c index 80d07a6ec99..513ccbd1062 100644 --- a/hw/core/gpio.c +++ b/hw/core/gpio.c @@ -21,6 +21,7 @@ #include "hw/qdev-core.h" #include "hw/irq.h" #include "qapi/error.h" +#include "qdev-internal.h" =20 static NamedGPIOList *qdev_get_named_gpio_list(DeviceState *dev, const char *name) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 05c1da3d311..0e6773c8df7 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -23,6 +23,7 @@ #include "hw/sysbus.h" #include "monitor/monitor.h" #include "exec/address-spaces.h" +#include "qdev-internal.h" =20 static void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *sysbus_get_fw_dev_path(DeviceState *dev); --=20 2.33.1