Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / drivers / bluetooth / hci_ldisc.c
index 613673b..93ba25b 100644 (file)
@@ -23,7 +23,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
@@ -192,7 +191,7 @@ static int hci_uart_flush(struct hci_dev *hdev)
 
        /* Flush any pending characters in the driver and discipline. */
        tty_ldisc_flush(tty);
-       if (tty->driver->flush_buffer)
+       if (tty->driver && tty->driver->flush_buffer)
                tty->driver->flush_buffer(tty);
 
        if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
@@ -291,7 +290,7 @@ static int hci_uart_tty_open(struct tty_struct *tty)
        if (tty->ldisc.flush_buffer)
                tty->ldisc.flush_buffer(tty);
 
-       if (tty->driver->flush_buffer)
+       if (tty->driver && tty->driver->flush_buffer)
                tty->driver->flush_buffer(tty);
 
        return 0;