aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_ldisc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 48ad2a7ab080..0d4da5e14ba0 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -357,22 +357,26 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty)
357 * 357 *
358 * Return Value: None 358 * Return Value: None
359 */ 359 */
360static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *flags, int count) 360static unsigned int hci_uart_tty_receive(struct tty_struct *tty,
361 const u8 *data, char *flags, int count)
361{ 362{
362 struct hci_uart *hu = (void *)tty->disc_data; 363 struct hci_uart *hu = (void *)tty->disc_data;
364 int received;
363 365
364 if (!hu || tty != hu->tty) 366 if (!hu || tty != hu->tty)
365 return; 367 return -ENODEV;
366 368
367 if (!test_bit(HCI_UART_PROTO_SET, &hu->flags)) 369 if (!test_bit(HCI_UART_PROTO_SET, &hu->flags))
368 return; 370 return -EINVAL;
369 371
370 spin_lock(&hu->rx_lock); 372 spin_lock(&hu->rx_lock);
371 hu->proto->recv(hu, (void *) data, count); 373 received = hu->proto->recv(hu, (void *) data, count);
372 hu->hdev->stat.byte_rx += count; 374 hu->hdev->stat.byte_rx += count;
373 spin_unlock(&hu->rx_lock); 375 spin_unlock(&hu->rx_lock);
374 376
375 tty_unthrottle(tty); 377 tty_unthrottle(tty);
378
379 return received;
376} 380}
377 381
378static int hci_uart_register_dev(struct hci_uart *hu) 382static int hci_uart_register_dev(struct hci_uart *hu)