Skip to content

Commit 9ad610d

Browse files
jfischer-nonashif
authored andcommitted
bluetooth: remove Kconfig options CONFIG_BT_*_ON_DEV_NAME
Follow up on commit bfd45e5 ("drivers: remove Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME") Remove Kconfig options CONFIG_BT_UART_ON_DEV_NAME and CONFIG_BT_MONITOR_ON_DEV_NAME since all UART drivers are converted to devicetree and we can just use DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart)) and DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_mon_uart)). Signed-off-by: Johann Fischer <[email protected]>
1 parent 58dbd41 commit 9ad610d

File tree

8 files changed

+12
-40
lines changed

8 files changed

+12
-40
lines changed

doc/reference/devicetree/api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ device.
308308
- Selects the UART used for host communication in the
309309
:ref:`bluetooth-hci-uart-sample`
310310
* - zephyr,bt-mon-uart
311-
- Sets default :kconfig:`CONFIG_BT_MONITOR_ON_DEV_NAME`
311+
- Sets UART device used for the Bluetooth monitor logging
312312
* - zephyr,bt-uart
313-
- Sets default :kconfig:`CONFIG_BT_UART_ON_DEV_NAME`
313+
- Sets UART device used by Bluetooth
314314
* - zephyr,can-primary
315315
- Sets the primary CAN controller
316316
* - zephyr,ccm

doc/releases/release-notes-2.7.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Removed APIs in this release
5050
* Removed ``CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_ACM`` and
5151
``CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_DEV_NAME`` Kconfig options
5252
in favor of chosen node ``zephyr,ot-uart``.
53+
* Removed ``CONFIG_BT_UART_ON_DEV_NAME`` Kconfig option
54+
in favor of direct use of chosen node ``zephyr,bt-uart``.
55+
* Removed ``CONFIG_BT_MONITOR_ON_DEV_NAME`` Kconfig option
56+
in favor of direct use of chosen node ``zephyr,bt-mon-uart``.
5357
* Removed ``CONFIG_UART_MCUMGR_ON_DEV_NAME`` Kconfig option
5458
in favor of direct use of chosen node ``zephyr,uart-mcumgr``.
5559
* Removed ``CONFIG_UART_CONSOLE_ON_DEV_NAME`` Kconfig option

drivers/bluetooth/hci/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,6 @@ config BT_NO_DRIVER
7676

7777
endchoice
7878

79-
# Workaround for not being able to have commas in macro arguments
80-
DT_CHOSEN_Z_BT_UART := zephyr,bt-uart
81-
82-
config BT_UART_ON_DEV_NAME
83-
string "Device Name of UART Device for Bluetooth"
84-
default "$(dt_chosen_label,$(DT_CHOSEN_Z_BT_UART))" if HAS_DTS
85-
default "UART_0"
86-
depends on BT_UART
87-
help
88-
This option specifies the name of UART device to be used
89-
for Bluetooth.
90-
9179
if BT_SPI
9280

9381
config BT_SPI_INIT_PRIORITY

drivers/bluetooth/hci/h4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ static int bt_uart_init(const struct device *unused)
510510
{
511511
ARG_UNUSED(unused);
512512

513-
h4_dev = device_get_binding(CONFIG_BT_UART_ON_DEV_NAME);
514-
if (!h4_dev) {
513+
h4_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart));
514+
if (!device_is_ready(h4_dev)) {
515515
return -EINVAL;
516516
}
517517

drivers/bluetooth/hci/h5.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,8 @@ static int bt_uart_init(const struct device *unused)
769769
{
770770
ARG_UNUSED(unused);
771771

772-
h5_dev = device_get_binding(CONFIG_BT_UART_ON_DEV_NAME);
773-
774-
if (h5_dev == NULL) {
772+
h5_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_uart));
773+
if (!device_is_ready(h5_dev)) {
775774
return -EINVAL;
776775
}
777776

soc/x86/atom/Kconfig.defconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ config UART_PIPE_ON_DEV_NAME
1717
default "UART_1"
1818
depends on UART_PIPE
1919

20-
config BT_MONITOR_ON_DEV_NAME
21-
default "UART_1" if BT_DEBUG_MONITOR_UART
22-
2320
endif
2421

2522
endif

subsys/bluetooth/common/Kconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -348,18 +348,6 @@ endchoice # Bluetooth debug type
348348

349349
if BT_DEBUG
350350

351-
# Workaround for not being able to have commas in macro arguments
352-
DT_CHOSEN_Z_BT_MON_UART := zephyr,bt-mon-uart
353-
354-
config BT_MONITOR_ON_DEV_NAME
355-
string "Device Name of Bluetooth monitor logging UART"
356-
depends on BT_DEBUG_MONITOR_UART
357-
default "$(dt_chosen_label,$(DT_CHOSEN_Z_BT_MON_UART))" if HAS_DTS
358-
default "UART_0"
359-
help
360-
This option specifies the name of UART device to be used
361-
for the Bluetooth monitor logging.
362-
363351
config BT_DEBUG_HCI_DRIVER
364352
bool "Bluetooth HCI driver debug"
365353
help

subsys/bluetooth/host/monitor.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,6 @@ extern void __printk_hook_install(int (*fn)(int));
233233
extern void __stdout_hook_install(int (*fn)(int));
234234
#endif /* !CONFIG_UART_CONSOLE */
235235

236-
#if defined(CONFIG_HAS_DTS) && !defined(CONFIG_BT_MONITOR_ON_DEV_NAME)
237-
#define CONFIG_BT_MONITOR_ON_DEV_NAME DT_LABEL(DT_CHOSEN(zephyr_console))
238-
#endif
239-
240236
#ifndef CONFIG_LOG_MINIMAL
241237
struct monitor_log_ctx {
242238
size_t total_len;
@@ -347,9 +343,9 @@ static int bt_monitor_init(const struct device *d)
347343
{
348344
ARG_UNUSED(d);
349345

350-
monitor_dev = device_get_binding(CONFIG_BT_MONITOR_ON_DEV_NAME);
346+
monitor_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_bt_mon_uart));
351347

352-
__ASSERT_NO_MSG(monitor_dev);
348+
__ASSERT_NO_MSG(device_is_ready(monitor_dev));
353349

354350
#if defined(CONFIG_UART_INTERRUPT_DRIVEN)
355351
uart_irq_rx_disable(monitor_dev);

0 commit comments

Comments
 (0)