Commit 92d092f7 authored by Ioannis Damigos's avatar Ioannis Damigos Committed by Benjamin Cabé
Browse files

include: drivers: bluetooth: Use DT_ENUM_IDX_OR to get HCI bus from DT



Use DT_ENUM_IDX_OR instead of DT_STRING_UPPER_TOKEN_OR to get HCI bus
from DT, in order to avoid the expansion of UART/SPI/etc. macros when
they exist in vendor's SoC headers.

Fixes #93675

Signed-off-by: default avatarIoannis Damigos <ioannis.damigos.uj@renesas.com>

fix
parent 70c70fda
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -87,8 +87,8 @@ enum bt_hci_bus {
#define BT_DT_HCI_NAME_GET(node_id) DT_PROP_OR(node_id, bt_hci_name, "HCI")
#define BT_DT_HCI_NAME_INST_GET(inst) BT_DT_HCI_NAME_GET(DT_DRV_INST(inst))

#define BT_DT_HCI_BUS_GET(node_id) \
	UTIL_CAT(BT_HCI_BUS_, DT_STRING_UPPER_TOKEN_OR(node_id, bt_hci_bus, VIRTUAL))
#define BT_DT_HCI_BUS_GET(node_id) DT_ENUM_IDX_OR(node_id, bt_hci_bus, BT_HCI_BUS_VIRTUAL)

#define BT_DT_HCI_BUS_INST_GET(inst) BT_DT_HCI_BUS_GET(DT_DRV_INST(inst))

typedef int (*bt_hci_recv_t)(const struct device *dev, struct net_buf *buf);