From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938614AbdDSRvH (ORCPT ); Wed, 19 Apr 2017 13:51:07 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:62084 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937549AbdDSRvE (ORCPT ); Wed, 19 Apr 2017 13:51:04 -0400 From: Arnd Bergmann To: Marcel Holtmann , Gustavo Padovan , Johan Hedberg Cc: Sebastian Reichel , Rob Herring , Arnd Bergmann , Bjorn Andersson , "David S. Miller" , Kalle Valo , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] blutooth: try to improve CONFIG_SERIAL_DEV_BUS dependency Date: Wed, 19 Apr 2017 19:50:18 +0200 Message-Id: <20170419175051.4177480-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:tdxQLZc4+n+46iFfYW0ld386FJdovMQV+q01TGxBzhjP2zTdbMv p8HGYbn3WAkWxZkuu4RjmrocT0RNKERT9EdmjxDXioP4C7HHAvr7xNEGg5MEPn3t47gzCZT 7vCiJlq1lEjDAPWkYP7lgGOR0g+NLWm13pDC/tgFXIxAtuExXasIES2+JxOS0zD8sxHex+0 Au7Bkd2UarEDA+xKf+yxA== X-UI-Out-Filterresults: notjunk:1;V01:K0:rOXtPu9/f2U=:uwqlRmwgE0YPR8c0WmO3W9 Wt3C75Mjp9MwFxV8T+MlSPU2x0hUh4p6/LNWe6UbbVMGcd8HoCP91y5odTu38/RvAbwrxPfY1 pbFHEsXvSmGzxgC2iU3wAi9U1gXN2BcJKvyolnLl3lpLQAs/F8Ffkd2C1Ish6nBHvOg5azP4n Nid6puqcnSSgwdAuJrMnYSTf22RKZvwLKWIaexgsdrNTfcWuSwObZsQYRq5dDO2zP5c43s3AT mvZbI9Wa93tPfw1UaL9+w4EsRQvDQ/4tJJGYLUNm0JDqeM6XIKtzSIqK2GGq86idNwur4hVS/ 2PmVfg7QJYfxnyUd8YI352kBMCXssFInHKX74UpuvuCrHkHSghfMb9aw8ElLyYK2zZG87UDSj 5GGpjwTKzRApKaprZ7jtBdeygVIBxv1wkPv92BlkAWcAu7SXSHsdY2mPTzTuX0TfUAeU5lEq9 10DQUoEDZjlUB60EfgjCNmiX6Ns0gK7GTG/jiZ3FzYu0cd4C2x+d1BMKCTVDMRdfeoE70Bxtq Ub/jQP/CVbv6afwRic8iPO6Gj5eSlnx1/1jVKckkiy0tUeW0HP22YQvgX6qBgPQjnfFrcBqwg /Xtn1bu4l2QvgeaOS1Hw1FFnr4q2EHTwXqRLTl/uqBt2fuVQAVQmAauLqpvs1SsP5lGnY7fIH I1C8xXKSaFG8pd10LHqyO8qhbobNfEn8tjIfCg2T8X4xA1touAF2KyPXfvBYAVqBxm8w= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 7bb318680e86 ("Bluetooth: add nokia driver") Signed-off-by: Arnd Bergmann --- drivers/bluetooth/Kconfig | 8 +++++++- drivers/bluetooth/Makefile | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 8aafbed9e160..737d93ef27c5 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig @@ -76,6 +76,12 @@ config BT_HCIUART Say Y here to compile support for Bluetooth UART devices into the 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 bool "UART (H4) protocol support" depends on BT_HCIUART @@ -89,7 +95,7 @@ config BT_HCIUART_H4 config BT_HCIUART_NOKIA tristate "UART Nokia H4+ protocol support" depends on BT_HCIUART - depends on SERIAL_DEV_BUS + depends on BT_HCIUART_SERDEV depends on PM help Nokia H4+ is serial protocol for communication between Bluetooth diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile index a7f237320f4b..e693ca6eeed9 100644 --- a/drivers/bluetooth/Makefile +++ b/drivers/bluetooth/Makefile @@ -31,7 +31,7 @@ btmrvl-y := btmrvl_main.o btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.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_BCSP) += hci_bcsp.o hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o -- 2.9.0