Skip to contentSkip to conversation

Build failure in linux-next: implicit declaration of acpi_has_method

PATCH Venkat Rao Bagalkote 3 participants 5 messages Apr 15

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Below diff fixes the build failure.

include/linux/acpi.h +0 -0
index bfacb9475aac..d3804f7f2610 100644
@@ -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;
+}
+
 static inline int acpi_register_wakeup_handler(int wake_irq, bool (*wakeup)(void *context), void *context)
 {

Please let me know, If this looks good, I can submit a formal patch.

Regards,

Venkat.

#1 lore raw
Quoted 12 lines · Venkat Rao Bagalkote

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]

Quoted 8 lines
  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.

Quoted 8 lines

Below diff fixes the build failure.

include/linux/acpi.h +0 -0
index bfacb9475aac..d3804f7f2610 100644

include/linux/acpi.h static inline const char · line 1108

Quoted 9 lines
include/linux/acpi.h +5 -0
@@ -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.

Quoted 3 lines
include/linux/acpi.h +0 -0
  static inline int acpi_register_wakeup_handler(int wake_irq,
         bool (*wakeup)(void *context), void *context)
  {
#2 lore raw
Quoted 18 lines · Rafael J. Wysocki
Quoted 16 lines · Venkat Rao Bagalkote

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
Quoted 5 lines
Quoted 3 lines

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.

Thank you so much for the review and explanation!!

Adding the stub, would just hide the real issue. I guess, proper fix is to add the ACPI dependency in Kconfig.

# git diff
drivers/bluetooth/Kconfig +0 -0
index c5d45cf91f88..fc1b37044a9b 100644
@@ -502,7 +502,7 @@ config BT_NXPUART
 

 config BT_INTEL_PCIE
        tristate "Intel HCI PCIe driver"
-       depends on PCI
+       depends on PCI && ACPI
        select BT_INTEL
        select FW_LOADER
        help

Can you please confirm, if this the right approach before I submit a formal patch.

Thank you again for your patience and guidance.

Regards,

Venkat.

Quoted 24 lines
Quoted 8 lines

Below diff fixes the build failure.

include/linux/acpi.h +0 -0
index bfacb9475aac..d3804f7f2610 100644

include/linux/acpi.h static inline const char · line 1108

Quoted 9 lines
include/linux/acpi.h +5 -0
@@ -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.

Quoted 3 lines
include/linux/acpi.h +0 -0
   static inline int acpi_register_wakeup_handler(int wake_irq,
          bool (*wakeup)(void *context), void *context)
   {
#3 lore raw
Quoted 5 lines · Venkat Rao Bagalkote
Quoted 2 lines · Rafael J. Wysocki

On Wed, Apr 15, 2026 at 9:16 AM Venkat Rao Bagalkote <[email protected]> wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

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’:

What kernel is this?

I cannot find the function above in the mainline.

Quoted 38 lines
Quoted 8 lines
Quoted 8 lines

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
Quoted 5 lines
Quoted 3 lines

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.

Thank you so much for the review and explanation!!

Adding the stub, would just hide the real issue. I guess, proper fix is to add the ACPI dependency in Kconfig.

# git diff
drivers/bluetooth/Kconfig +1 -1
index c5d45cf91f88..fc1b37044a9b 100644
@@ -502,7 +502,7 @@ config BT_NXPUART
 
  config BT_INTEL_PCIE
         tristate "Intel HCI PCIe driver"
-       depends on PCI
+       depends on PCI && ACPI
         select BT_INTEL
         select FW_LOADER
         help
Quoted 2 lines

Can you please confirm, if this the right approach before I submit a formal patch.

I'm not sure about that. You need to talk to the driver maintainer.

Quoted 1 line

Thank you again for your patience and guidance.

You're welcome.

#4 lore raw

Le 15/04/2026 à 16:13, Rafael J. Wysocki a écrit :

Quoted 9 lines
Quoted 7 lines · Venkat Rao Bagalkote
Quoted 4 lines · Rafael J. Wysocki
Quoted 2 lines · Venkat Rao Bagalkote

Greetings!!!

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

IBM CI has reported a build failure on linux-next repo.

Failures:

drivers/bluetooth/btintel_pcie.c: In function
‘btintel_pcie_acpi_reset_method’:

What kernel is this?

linux-next, https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next

$ git grep btintel_pcie_acpi_reset_method next-20260415
next-20260415:drivers/bluetooth/btintel_pcie.c:static int btintel_pcie_acpi_reset_method(struct btintel_pcie_data *data)
next-20260415:drivers/bluetooth/btintel_pcie.c: ret = btintel_pcie_acpi_reset_method(data);

commit 912a499a7955 ("Bluetooth: btintel_pcie: Support Product level reset")

Quoted 49 lines

I cannot find the function above in the mainline.

Quoted 38 lines
Quoted 8 lines
Quoted 8 lines

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
Quoted 5 lines
Quoted 3 lines

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.

Thank you so much for the review and explanation!!

Adding the stub, would just hide the real issue. I guess, proper fix is to add the ACPI dependency in Kconfig.

# git diff
drivers/bluetooth/Kconfig +1 -1
index c5d45cf91f88..fc1b37044a9b 100644
@@ -502,7 +502,7 @@ config BT_NXPUART
 
   config BT_INTEL_PCIE
          tristate "Intel HCI PCIe driver"
-       depends on PCI
+       depends on PCI && ACPI
          select BT_INTEL
          select FW_LOADER
          help
Quoted 2 lines

Can you please confirm, if this the right approach before I submit a formal patch.

I'm not sure about that. You need to talk to the driver maintainer.

Quoted 1 line

Thank you again for your patience and guidance.

You're welcome.