Commit 1fb78fb6 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Marcel Holtmann

Bluetooth: try to improve CONFIG_SERIAL_DEV_BUS dependency

With CONFIG_SERIAL_DEV_BUS=m, the hci_serdev.o file does not actually
get built into hci_uart.o as the Makefile doesn't pick it up, leading
to a link error with anything referring to it:

ERROR: "hci_uart_register_device" [drivers/bluetooth/hci_nokia.ko] undefined!
scripts/Makefile.modpost:91: recipe for target '__modpost' failed

Changing this in the Makefile would cause another problem when
hci_uart itself is built-in and cannot reference symbols from the
serdev module.

This tries to address both problems by introducing a new hidden
Kconfig symbol that controls both the compilation of hci_serdev.o
and whether the Nokia driver can be selected. This seems to address
the problem for me, though there might be a better way to do it.

Fixes: 7bb31868 ("Bluetooth: add nokia driver")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f2edd9f6
...@@ -76,6 +76,12 @@ config BT_HCIUART ...@@ -76,6 +76,12 @@ config BT_HCIUART
Say Y here to compile support for Bluetooth UART devices into the Say Y here to compile support for Bluetooth UART devices into the
kernel or say M to compile it as module (hci_uart). kernel or say M to compile it as module (hci_uart).
config BT_HCIUART_SERDEV
bool
depends on SERIAL_DEV_BUS && BT_HCIUART
depends on SERIAL_DEV_BUS=y || SERIAL_DEV_BUS=BT_HCIUART
default y
config BT_HCIUART_H4 config BT_HCIUART_H4
bool "UART (H4) protocol support" bool "UART (H4) protocol support"
depends on BT_HCIUART depends on BT_HCIUART
...@@ -89,7 +95,7 @@ config BT_HCIUART_H4 ...@@ -89,7 +95,7 @@ config BT_HCIUART_H4
config BT_HCIUART_NOKIA config BT_HCIUART_NOKIA
tristate "UART Nokia H4+ protocol support" tristate "UART Nokia H4+ protocol support"
depends on BT_HCIUART depends on BT_HCIUART
depends on SERIAL_DEV_BUS depends on BT_HCIUART_SERDEV
depends on PM depends on PM
help help
Nokia H4+ is serial protocol for communication between Bluetooth Nokia H4+ is serial protocol for communication between Bluetooth
......
...@@ -31,7 +31,7 @@ btmrvl-y := btmrvl_main.o ...@@ -31,7 +31,7 @@ btmrvl-y := btmrvl_main.o
btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o
hci_uart-y := hci_ldisc.o hci_uart-y := hci_ldisc.o
hci_uart-$(CONFIG_SERIAL_DEV_BUS) += hci_serdev.o hci_uart-$(CONFIG_BT_HCIUART_SERDEV) += hci_serdev.o
hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o
hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment