[PATCH v2] ACPI: Add stub for acpi_find_child_device()
Provide a NULL-returning stub when CONFIG_ACPI is disabled so callers can be compiled without ACPI support. Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/linux-sound/20260925131104.118993-1-arnd@kernel.org/ Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> --- v2: * Move to acpi_bus.h Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Cc: Bard Liao <yung-chuan.liao@linux.intel.com> Cc: Daniel Baluta <daniel.baluta@nxp.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Cc: sound-open-firmware@alsa-project.org --- include/acpi/acpi_bus.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7dbe5d42c67e8..b7771b4f36c80 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -954,6 +954,8 @@ u32 arch_acpi_add_auto_dep(acpi_handle handle); #else /* CONFIG_ACPI */ +#define acpi_find_child_device(...) (NULL) + static inline bool acpi_has_method(acpi_handle handle, char *name) { return false; -- 2.43.0
On Fri, Sep 25, 2026 at 5:53 PM Mario Limonciello <mario.limonciello@amd.com> wrote:
Provide a NULL-returning stub when CONFIG_ACPI is disabled so callers can be compiled without ACPI support.
Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/linux-sound/20260925131104.118993-1-arnd@kernel.org/ Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> --- v2: * Move to acpi_bus.h Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Cc: Bard Liao <yung-chuan.liao@linux.intel.com> Cc: Daniel Baluta <daniel.baluta@nxp.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Cc: sound-open-firmware@alsa-project.org --- include/acpi/acpi_bus.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7dbe5d42c67e8..b7771b4f36c80 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -954,6 +954,8 @@ u32 arch_acpi_add_auto_dep(acpi_handle handle);
#else /* CONFIG_ACPI */
+#define acpi_find_child_device(...) (NULL)
Well, thanks, but I'd prefer a static inline stub. Any issues with that?
static inline bool acpi_has_method(acpi_handle handle, char *name) { return false; -- 2.43.0
On 9/25/26 10:54, Rafael J. Wysocki (Intel) wrote:
On Fri, Sep 25, 2026 at 5:53 PM Mario Limonciello <mario.limonciello@amd.com> wrote:
Provide a NULL-returning stub when CONFIG_ACPI is disabled so callers can be compiled without ACPI support.
Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/linux-sound/20260925131104.118993-1-arnd@kernel.org/ Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> --- v2: * Move to acpi_bus.h Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Cc: Bard Liao <yung-chuan.liao@linux.intel.com> Cc: Daniel Baluta <daniel.baluta@nxp.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Cc: sound-open-firmware@alsa-project.org --- include/acpi/acpi_bus.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 7dbe5d42c67e8..b7771b4f36c80 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -954,6 +954,8 @@ u32 arch_acpi_add_auto_dep(acpi_handle handle);
#else /* CONFIG_ACPI */
+#define acpi_find_child_device(...) (NULL)
Well, thanks, but I'd prefer a static inline stub. Any issues with that?
That should be fine, I'll test it and send out a v3.
participants (2)
-
Mario Limonciello -
Rafael J. Wysocki (Intel)