Skip to contentSkip to conversation

Bluetooth: btmtk: Fix btmtk.c undefined reference build error

PATCH Applied Chris Lu 3 participants 3 messages Jul 19, 2024

Subsystems (2)
lore
Share & tools
lore

Chris Lu

author
#0 lore raw

PATCH v4 1/1 Bluetooth: btmtk: Fix btmtk.c undefined reference build error

MediaTek moved some usb interface related function to btmtk.c which may cause build failed if BT USB Kconfig wasn't enabled. Fix undefined reference by adding config check.

btmtk.c:(.text+0x89c): undefined reference to usb_alloc_urb' btmtk.c:(.text+0x8e3): undefined reference to usb_free_urb' btmtk.c:(.text+0x956): undefined reference to usb_free_urb' btmtk.c:(.text+0xa0e): undefined reference to usb_anchor_urb' btmtk.c:(.text+0xb43): undefined reference to usb_autopm_get_interface' btmtk.c:(.text+0xb7e): undefined reference to usb_autopm_put_interface' btmtk.c:(.text+0xf70): undefined reference to usb_disable_autosuspend' btmtk.c:(.text+0x133a): undefined reference to usb_control_msg'

Fixes d019930b0049 ("Bluetooth: btmtk: move btusb_mtk_hci_wmt_sync to btmtk.c")

---
Change from v3 to v4:
-rebase code base

---
 drivers/bluetooth/btmtk.c | 2 ++
 drivers/bluetooth/btmtk.h | 2 ++
 2 files changed, 4 insertions(+)
drivers/bluetooth/btmtk.c +2 -0
index 191bc6925120..2b7c80043aa2 100644
@@ -437,6 +437,7 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
 }
 EXPORT_SYMBOL_GPL(btmtk_process_coredump);
 
+#if IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK)
 static void btmtk_usb_wmt_recv(struct urb *urb)
 {
 	struct hci_dev *hdev = urb->context;
@@ -1488,6 +1489,7 @@ int btmtk_usb_shutdown(struct hci_dev *hdev)
 	return 0;
 }
 EXPORT_SYMBOL_GPL(btmtk_usb_shutdown);
+#endif
 
 MODULE_AUTHOR("Sean Wang <[email protected]>");
 MODULE_AUTHOR("Mark Chen <[email protected]>");
drivers/bluetooth/btmtk.h +2 -0
index 5df7c3296624..6fc69cd8636b 100644
@@ -202,6 +202,7 @@ int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb);
 void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id, u32 fw_ver,
 			   u32 fw_flavor);
 
+#if IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK)
 int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id);
 
 int btmtk_usb_recv_acl(struct hci_dev *hdev, struct sk_buff *skb);
@@ -216,6 +217,7 @@ int btmtk_usb_suspend(struct hci_dev *hdev);
 int btmtk_usb_setup(struct hci_dev *hdev);
 
 int btmtk_usb_shutdown(struct hci_dev *hdev);
+#endif
 #else
 
 static inline int btmtk_set_bdaddr(struct hci_dev *hdev,
Signature · 1 line
2.18.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=872398

---Test result---

Test Summary:

CheckPatch                    PASS      0.84 seconds
GitLint                       FAIL      0.50 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      29.66 seconds
CheckAllWarning               PASS      32.08 seconds
CheckSparse                   PASS      37.86 seconds
CheckSmatch                   PASS      102.66 seconds
BuildKernel32                 PASS      28.67 seconds
TestRunnerSetup               PASS      525.60 seconds
TestRunner_l2cap-tester       PASS      22.15 seconds
TestRunner_iso-tester         PASS      31.05 seconds
TestRunner_bnep-tester        PASS      4.87 seconds
TestRunner_mgmt-tester        PASS      113.19 seconds
TestRunner_rfcomm-tester      PASS      7.53 seconds
TestRunner_sco-tester         PASS      15.09 seconds
TestRunner_ioctl-tester       PASS      11.71 seconds
TestRunner_mesh-tester        PASS      6.10 seconds
TestRunner_smp-tester         PASS      6.99 seconds
TestRunner_userchan-tester    PASS      5.08 seconds
IncrementalBuild              PASS      27.42 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v4] Bluetooth: btmtk: Fix btmtk.c undefined reference build error

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
17: B1 Line exceeds max length (82>80): "Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/"

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Chris Lu
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 13 lines · On Fri, 19 Jul 2024 11:30:19 +0800 you wrote:

MediaTek moved some usb interface related function to btmtk.c which may cause build failed if BT USB Kconfig wasn't enabled. Fix undefined reference by adding config check.

btmtk.c:(.text+0x89c): undefined reference to usb_alloc_urb' btmtk.c:(.text+0x8e3): undefined reference to usb_free_urb' btmtk.c:(.text+0x956): undefined reference to usb_free_urb' btmtk.c:(.text+0xa0e): undefined reference to usb_anchor_urb' btmtk.c:(.text+0xb43): undefined reference to usb_autopm_get_interface' btmtk.c:(.text+0xb7e): undefined reference to usb_autopm_put_interface' btmtk.c:(.text+0xf70): undefined reference to usb_disable_autosuspend' btmtk.c:(.text+0x133a): undefined reference to usb_control_msg'

Quoted 1 line

[...]

Here is the summary with links:
- [v4] Bluetooth: btmtk: Fix btmtk.c undefined reference build error

    https://git.kernel.org/bluetooth/bluetooth-next/c/52828ea60dfd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html