[PATCH 1/1] Bluetooth: hci_uart: check for missing tty operations

From: Yuanjun Gong
Date: Thu Apr 07 2022 - 00:42:18 EST


From: Gong Yuanjun <ruc_gongyuanjun@xxxxxxx>

Add a check to the missing tty operations in hci_ag6xx,
hci_h4, hci_ll following the implementations in hci_ath.

Signed-off-by: Gong Yuanjun <ruc_gongyuanjun@xxxxxxx>
---
drivers/bluetooth/hci_ag6xx.c | 3 +++
drivers/bluetooth/hci_h4.c | 3 +++
drivers/bluetooth/hci_ll.c | 3 +++
3 files changed, 9 insertions(+)

diff --git a/drivers/bluetooth/hci_ag6xx.c b/drivers/bluetooth/hci_ag6xx.c
index 2d40302409ff..a5f141d43066 100644
--- a/drivers/bluetooth/hci_ag6xx.c
+++ b/drivers/bluetooth/hci_ag6xx.c
@@ -36,6 +36,9 @@ static int ag6xx_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

+ if (!hci_uart_has_flow_control(hu))
+ return -EOPNOTSUPP;
+
ag6xx = kzalloc(sizeof(*ag6xx), GFP_KERNEL);
if (!ag6xx)
return -ENOMEM;
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index 1d0cdf023243..0ceabe340351 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -44,6 +44,9 @@ static int h4_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

+ if (!hci_uart_has_flow_control(hu))
+ return -EOPNOTSUPP;
+
h4 = kzalloc(sizeof(*h4), GFP_KERNEL);
if (!h4)
return -ENOMEM;
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index 4eb420a9ed04..22166df1467f 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -114,6 +114,9 @@ static int ll_open(struct hci_uart *hu)

BT_DBG("hu %p", hu);

+ if (!hci_uart_has_flow_control(hu))
+ return -EOPNOTSUPP;
+
ll = kzalloc(sizeof(*ll), GFP_KERNEL);
if (!ll)
return -ENOMEM;
--
2.17.1