You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

编译5.15.59内核蓝牙驱动模块时遇__regmap_init未定义错误求助

问题

为NAS设备编译USB蓝牙驱动内核模块(内核版本5.15.59),net/bluetooth模块可通过以下命令正常编译:

make M=net/bluetooth

但编译drivers/bluetooth/btintel.ko时出现错误:

ERROR: modpost: "__regmap_init" [drivers/bluetooth/btintel.ko] undefined!

尝试使用以下命令编译仍失败:

make KBUILD_EXTRA_SYMBOLS=net/bluetooth/Module.symvers M=drivers/bluetooth

相关.config配置片段:

CONFIG_BT=m
CONFIG_BT_BREDR=y
CONFIG_BT_RFCOMM=m
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=m
# CONFIG_BT_HS is not set
# CONFIG_BT_LE is not set
# CONFIG_BT_MSFTEXT is not set
# CONFIG_BT_AOSPEXT is not set
# CONFIG_BT_DEBUGFS is not set
# CONFIG_BT_SELFTEST is not set
# CONFIG_BT_FEATURE_DEBUG is not set

#
# Bluetooth device drivers
#
CONFIG_BT_INTEL=m
CONFIG_BT_RTL=m
CONFIG_BT_HCIBTUSB=m
# CONFIG_BT_HCIBTUSB_AUTOSUSPEND is not set
# CONFIG_BT_HCIBTUSB_BCM is not set
# CONFIG_BT_HCIBTUSB_MTK is not set
CONFIG_BT_HCIBTUSB_RTL=y
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
# CONFIG_BT_HCIUART_AG6XX is not set
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIDTL1 is not set
# CONFIG_BT_HCIBT3C is not set
# CONFIG_BT_HCIBLUECARD is not set
CONFIG_BT_HCIVHCI=m
# CONFIG_BT_MRVL is not set
# CONFIG_BT_ATH3K is not set
# end of Bluetooth device drivers
解决方案

__regmap_init符号来自内核的regmap框架模块,当前.config未开启相关配置,导致编译btintel时找不到该符号。

  1. 修改内核.config文件,添加或开启以下配置:

    CONFIG_REGMAP=m
    

    也可直接将CONFIG_REGMAP设为y(编译进内核而非模块),若蓝牙设备涉及I2C通信,可额外开启CONFIG_REGMAP_I2C=m。

  2. 重新编译时,可选择以下方式:

    • 先编译regmap模块,再编译btintel:
      make M=drivers/base/regmap
      make M=drivers/bluetooth
      
    • 或者通过KBUILD_EXTRA_SYMBOLS指定regmap的符号文件路径:
      make KBUILD_EXTRA_SYMBOLS=drivers/base/regmap/Module.symvers M=drivers/bluetooth
      

完成以上操作后,btintel.ko即可正常编译,所需的__regmap_init符号将由regmap模块提供。

内容的提问来源于stack exchange,提问作者outkastm

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 02:17:24