From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Hanjun Guo" <guohanjun@huawei.com>,
"Sudeep Holla" <sudeep.holla@kernel.org>,
linux-arm-kernel@lists.infradead.org,
"Ard Biesheuvel" <ardb@kernel.org>,
"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
linux-efi@vger.kernel.org, "Will Deacon" <will@kernel.org>,
"Robin Murphy" <robin.murphy@arm.com>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
"Mark Pearson" <mpearson-lenovo@squebb.ca>,
"Derek J. Clark" <derekjohn.clark@gmail.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
platform-driver-x86@vger.kernel.org,
"David Rhodes" <david.rhodes@cirrus.com>,
"Richard Fitzgerald" <rf@opensource.cirrus.com>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
linux-sound@vger.kernel.org,
"Shenghao Ding" <shenghao-ding@ti.com>,
"Kevin Lu" <kevin-lu@ti.com>, "Baojun Xu" <baojun.xu@ti.com>,
"Sen Wang" <sen@ti.com>,
"Vijendar Mukunda" <Vijendar.Mukunda@amd.com>,
"Venkata Prasad Potturu" <venkataprasad.potturu@amd.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Cezary Rojewski" <cezary.rojewski@intel.com>,
"Peter Ujfalusi" <peter.ujfalusi@linux.intel.com>,
"Bard Liao" <yung-chuan.liao@linux.intel.com>,
"Kai Vehmanen" <kai.vehmanen@linux.intel.com>,
"Pierre-Louis Bossart" <pierre-louis.bossart@linux.dev>,
"Binbin Zhou" <zhoubinbin@loongson.cn>,
"Andreas Noever" <andreas.noever@gmail.com>,
"Mika Westerberg" <westeri@kernel.org>,
"Yehezkel Bernat" <YehezkelShB@gmail.com>
Subject: [PATCH v1 01/17] ACPI: bus: Use acpi/acpi_bus.h without CONFIG_ACPI
Date: Mon, 21 Sep 2026 21:45:59 +0200 [thread overview]
Message-ID: <3717753.iIbC2pHGDl@rafael.j.wysocki> (raw)
In-Reply-To: <7995179.EvYhyI6sBW@rafael.j.wysocki>
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Corrently acpi/acpi_bus.h is included in linux/acpi.h only if
CONFIG_ACPI is set, but it contains declarations that are useful
otherwise too.
For consistency, modify linux/acpi.h to always include acpi/acpi_bus.h
and update the latter to avoid exposing too much when CONFIG_ACPI is
not set.
Since acpi_has_method() is called from some code build when
CONFIG_ACPI is unset, add a stub for it to the !CONFIG_ACPI
block in acpi/acpi_bus.h.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
include/acpi/acpi_bus.h | 12 ++++++++----
include/linux/acpi.h | 2 +-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index a10a591c18b2..32837f507f40 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -9,6 +9,8 @@
#ifndef __ACPI_BUS_H__
#define __ACPI_BUS_H__
+#ifdef CONFIG_ACPI
+
#include <linux/completion.h>
#include <linux/container_of.h>
#include <linux/device.h>
@@ -58,7 +60,6 @@ bool acpi_dock_match(acpi_handle handle);
bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs);
union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid,
u64 rev, u64 func, union acpi_object *argv4);
-#ifdef CONFIG_ACPI
bool
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
@@ -77,7 +78,6 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev,
return obj;
}
-#endif
#define ACPI_INIT_DSM_ARGV4(cnt, eles) \
{ \
@@ -90,8 +90,6 @@ bool acpi_dev_found(const char *hid);
bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
bool acpi_reduced_hardware(void);
-#ifdef CONFIG_ACPI
-
struct proc_dir_entry;
#define ACPI_BUS_FILE_ROOT "acpi"
@@ -942,8 +940,14 @@ int acpi_wait_for_acpi_ipmi(void);
int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices);
u32 arch_acpi_add_auto_dep(acpi_handle handle);
+
#else /* CONFIG_ACPI */
+static inline bool acpi_has_method(acpi_handle handle, char *name)
+{
+ return false;
+}
+
static inline struct device *acpi_bus_get_primary_device(struct acpi_device *adev)
{
return NULL;
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index ddacac812094..ba5234bd93a2 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,6 +25,7 @@ struct irq_domain_ops;
#define _LINUX
#endif
#include <acpi/acpi.h>
+#include <acpi/acpi_bus.h>
#include <acpi/acpi_numa.h>
#ifdef CONFIG_ACPI
@@ -35,7 +36,6 @@ struct irq_domain_ops;
#include <linux/mutex.h>
#include <linux/fw_table.h>
-#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_io.h>
#include <asm/acpi.h>
--
2.51.0
next prev parent reply other threads:[~2026-09-21 20:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 19:45 [PATCH v1 00/17] ACPI: Replace acpi_get_first_physical_node() with acpi_bus_get_primary_device() Rafael J. Wysocki
2026-09-21 19:45 ` Rafael J. Wysocki [this message]
2026-09-21 19:46 ` [PATCH v1 02/17] ACPI: amba: Switch to use acpi_bus_get_primary_device() Rafael J. Wysocki
2026-09-22 6:07 ` Hanjun Guo
2026-09-21 19:47 ` [PATCH v1 03/17] efi/dev-path-parser: " Rafael J. Wysocki
2026-09-21 19:47 ` [PATCH v1 04/17] iommu/arm-smmu-v3: " Rafael J. Wysocki
2026-09-21 19:48 ` [PATCH v1 05/17] platform/x86: yogabook: " Rafael J. Wysocki
2026-09-21 19:49 ` [PATCH v1 06/17] platform/x86: serdev_helpers: " Rafael J. Wysocki
2026-09-21 19:49 ` [PATCH v1 07/17] platform/x86: apple-gmux: " Rafael J. Wysocki
2026-09-21 19:50 ` [PATCH v1 08/17] platform/x86: x86-android-tablets: Use acpi_bus_get_primary_device() Rafael J. Wysocki
2026-09-21 19:51 ` [PATCH v1 09/17] thunderbolt: Switch to use acpi_bus_get_primary_device() Rafael J. Wysocki
2026-09-21 19:51 ` [PATCH v1 10/17] ALSA: hda: cs35l41: " Rafael J. Wysocki
2026-09-21 19:52 ` [PATCH v1 11/17] ALSA: hda: aw88399: " Rafael J. Wysocki
2026-09-21 19:53 ` [PATCH v1 12/17] ALSA: hda: tas2781: " Rafael J. Wysocki
2026-09-21 19:53 ` [PATCH v1 13/17] ASoC: amd: acp-es8336: " Rafael J. Wysocki
2026-09-21 19:54 ` [PATCH v1 14/17] ASoC: amd: acp3x-es83xx: " Rafael J. Wysocki
2026-09-21 19:55 ` [PATCH v1 15/17] ASoC: intel: boards: " Rafael J. Wysocki
2026-09-21 19:55 ` [PATCH v1 16/17] ASoC: loongson: " Rafael J. Wysocki
2026-09-21 19:56 ` [PATCH v1 17/17] ACPI: bus: Drop acpi_get_first_physical_node() Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3717753.iIbC2pHGDl@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=Vijendar.Mukunda@amd.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ardb@kernel.org \
--cc=baojun.xu@ti.com \
--cc=broonie@kernel.org \
--cc=cezary.rojewski@intel.com \
--cc=david.rhodes@cirrus.com \
--cc=derekjohn.clark@gmail.com \
--cc=guohanjun@huawei.com \
--cc=hansg@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=joro@8bytes.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=kevin-lu@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=mpearson-lenovo@squebb.ca \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rf@opensource.cirrus.com \
--cc=robin.murphy@arm.com \
--cc=sen@ti.com \
--cc=shenghao-ding@ti.com \
--cc=sudeep.holla@kernel.org \
--cc=tiwai@suse.com \
--cc=venkataprasad.potturu@amd.com \
--cc=westeri@kernel.org \
--cc=will@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®