Re: Build failure in linux-next: implicit declaration of acpi_has_method

From: Rafael J. Wysocki

Date: Wed Apr 15 2026 - 03:22:48 EST


On Wed, Apr 15, 2026 at 9:16 AM Venkat Rao Bagalkote
<venkat88@xxxxxxxxxxxxx> wrote:
>
> Greetings!!!
>
> IBM CI has reported a build failure on linux-next repo.
>
> Failures:
>
> drivers/bluetooth/btintel_pcie.c: In function
> ‘btintel_pcie_acpi_reset_method’:
> drivers/bluetooth/btintel_pcie.c:2309:14: error: implicit declaration of
> function ‘acpi_has_method’; did you mean ‘acpi_has_watchdog’?
> [-Werror=implicit-function-declaration]
> 2309 | if (!acpi_has_method(handle, "_PRR")) {
> | ^~~~~~~~~~~~~~~
> | acpi_has_watchdog
>
>
> The function acpi_has_method() lacks a stub definition in
> include/linux/acpi.h
> for the !CONFIG_ACPI case, unlike other ACPI utility functions.

Code that calls acpi_has_method() clearly depends on ACPI though, so
building it in the !CONFIG_ACPI case is questionable.

> Below diff fixes the build failure.
>
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index bfacb9475aac..d3804f7f2610 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -1100,6 +1100,11 @@ static inline const char
> *acpi_get_subsystem_id(acpi_handle handle)
> return ERR_PTR(-ENODEV);
> }
>
> +static inline bool acpi_has_method(acpi_handle handle, char *name)
> +{
> + return false;
> +}
> +

This doesn't belong in include/linux/acpi.h.

It might go into include/acpi/acpi_bus.h, but see above.

> static inline int acpi_register_wakeup_handler(int wake_irq,
> bool (*wakeup)(void *context), void *context)
> {