aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/hci_ldisc.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-09-21 10:23:19 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:01:30 -0400
commit7785162cf2baf7c6c1e4ad8ae5888f85fcc5febc (patch)
tree440e68917ac0f276bbfa32e58d79b29666220b9f /drivers/bluetooth/hci_ldisc.c
parent62ae15919b6db6644049338296624fbd724c0054 (diff)
[Bluetooth] Code cleanup for the HCI UART driver
This patch cleans up the Bluetooth HCI UART driver a bit. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r--drivers/bluetooth/hci_ldisc.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 93ba25b7ea32..420b645c4c9f 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -241,15 +241,11 @@ static int hci_uart_send_frame(struct sk_buff *skb)
241 241
242static void hci_uart_destruct(struct hci_dev *hdev) 242static void hci_uart_destruct(struct hci_dev *hdev)
243{ 243{
244 struct hci_uart *hu;
245
246 if (!hdev) 244 if (!hdev)
247 return; 245 return;
248 246
249 BT_DBG("%s", hdev->name); 247 BT_DBG("%s", hdev->name);
250 248 kfree(hdev->driver_data);
251 hu = (struct hci_uart *) hdev->driver_data;
252 kfree(hu);
253} 249}
254 250
255/* ------ LDISC part ------ */ 251/* ------ LDISC part ------ */
@@ -272,7 +268,7 @@ static int hci_uart_tty_open(struct tty_struct *tty)
272 return -EEXIST; 268 return -EEXIST;
273 269
274 if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) { 270 if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
275 BT_ERR("Can't allocate controll structure"); 271 BT_ERR("Can't allocate control structure");
276 return -ENFILE; 272 return -ENFILE;
277 } 273 }
278 274
@@ -360,7 +356,7 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty)
360 * 356 *
361 * Return Value: None 357 * Return Value: None
362 */ 358 */
363static void hci_uart_tty_receive(struct tty_struct *tty, const __u8 *data, char *flags, int count) 359static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *flags, int count)
364{ 360{
365 struct hci_uart *hu = (void *)tty->disc_data; 361 struct hci_uart *hu = (void *)tty->disc_data;
366 362
@@ -375,7 +371,8 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const __u8 *data, char
375 hu->hdev->stat.byte_rx += count; 371 hu->hdev->stat.byte_rx += count;
376 spin_unlock(&hu->rx_lock); 372 spin_unlock(&hu->rx_lock);
377 373
378 if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver->unthrottle) 374 if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) &&
375 tty->driver->unthrottle)
379 tty->driver->unthrottle(tty); 376 tty->driver->unthrottle(tty);
380} 377}
381 378