aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_ldisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r--drivers/bluetooth/hci_ldisc.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 320f71803a2b..b3f01996318f 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -355,26 +355,29 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty)
355 * flags pointer to flags for data 355 * flags pointer to flags for data
356 * count count of received data in bytes 356 * count count of received data in bytes
357 * 357 *
358 * Return Value: None 358 * Return Value: Number of bytes received
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 int ret;
363 struct hci_uart *hu = (void *)tty->disc_data; 363 struct hci_uart *hu = (void *)tty->disc_data;
364 int received;
364 365
365 if (!hu || tty != hu->tty) 366 if (!hu || tty != hu->tty)
366 return; 367 return -ENODEV;
367 368
368 if (!test_bit(HCI_UART_PROTO_SET, &hu->flags)) 369 if (!test_bit(HCI_UART_PROTO_SET, &hu->flags))
369 return; 370 return -EINVAL;
370 371
371 spin_lock(&hu->rx_lock); 372 spin_lock(&hu->rx_lock);
372 ret = hu->proto->recv(hu, (void *) data, count); 373 received = hu->proto->recv(hu, (void *) data, count);
373 if (ret > 0) 374 if (received > 0)
374 hu->hdev->stat.byte_rx += count; 375 hu->hdev->stat.byte_rx += received;
375 spin_unlock(&hu->rx_lock); 376 spin_unlock(&hu->rx_lock);
376 377
377 tty_unthrottle(tty); 378 tty_unthrottle(tty);
379
380 return received;
378} 381}
379 382
380static int hci_uart_register_dev(struct hci_uart *hu) 383static int hci_uart_register_dev(struct hci_uart *hu)