diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:54:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:47 -0400 |
commit | f34d7a5b7010b82fe97da95496b9971435530062 (patch) | |
tree | 87e2abec1e33ed4fe5e63ee2fd000bc2ad745e57 /drivers/bluetooth | |
parent | 251b8dd7eee30fda089a1dc088abf4fc9a0dee9c (diff) |
tty: The big operations rework
- Operations are now a shared const function block as with most other Linux
objects
- Introduce wrappers for some optional functions to get consistent behaviour
- Wrap put_char which used to be patched by the tty layer
- Document which functions are needed/optional
- Make put_char report success/fail
- Cache the driver->ops pointer in the tty as tty->ops
- Remove various surplus lock calls we no longer need
- Remove proc_write method as noted by Alexey Dobriyan
- Introduce some missing sanity checks where certain driver/ldisc
combinations would oops as they didn't check needed methods were present
[akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
[akpm@linux-foundation.org: fix isicom]
[akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
[akpm@linux-foundation.org: fix kgdb]
Signed-off-by: Alan Cox <alan@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 7e31d5f1bc8..a6c2619ec78 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -143,7 +143,7 @@ restart: | |||
143 | int len; | 143 | int len; |
144 | 144 | ||
145 | set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); | 145 | set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
146 | len = tty->driver->write(tty, skb->data, skb->len); | 146 | len = tty->ops->write(tty, skb->data, skb->len); |
147 | hdev->stat.byte_tx += len; | 147 | hdev->stat.byte_tx += len; |
148 | 148 | ||
149 | skb_pull(skb, len); | 149 | skb_pull(skb, len); |
@@ -190,8 +190,7 @@ static int hci_uart_flush(struct hci_dev *hdev) | |||
190 | 190 | ||
191 | /* Flush any pending characters in the driver and discipline. */ | 191 | /* Flush any pending characters in the driver and discipline. */ |
192 | tty_ldisc_flush(tty); | 192 | tty_ldisc_flush(tty); |
193 | if (tty->driver && tty->driver->flush_buffer) | 193 | tty_driver_flush_buffer(tty); |
194 | tty->driver->flush_buffer(tty); | ||
195 | 194 | ||
196 | if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) | 195 | if (test_bit(HCI_UART_PROTO_SET, &hu->flags)) |
197 | hu->proto->flush(hu); | 196 | hu->proto->flush(hu); |
@@ -285,9 +284,7 @@ static int hci_uart_tty_open(struct tty_struct *tty) | |||
285 | 284 | ||
286 | if (tty->ldisc.flush_buffer) | 285 | if (tty->ldisc.flush_buffer) |
287 | tty->ldisc.flush_buffer(tty); | 286 | tty->ldisc.flush_buffer(tty); |
288 | 287 | tty_driver_flush_buffer(tty); | |
289 | if (tty->driver && tty->driver->flush_buffer) | ||
290 | tty->driver->flush_buffer(tty); | ||
291 | 288 | ||
292 | return 0; | 289 | return 0; |
293 | } | 290 | } |
@@ -374,8 +371,8 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *f | |||
374 | spin_unlock(&hu->rx_lock); | 371 | spin_unlock(&hu->rx_lock); |
375 | 372 | ||
376 | if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) && | 373 | if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) && |
377 | tty->driver->unthrottle) | 374 | tty->ops->unthrottle) |
378 | tty->driver->unthrottle(tty); | 375 | tty->ops->unthrottle(tty); |
379 | } | 376 | } |
380 | 377 | ||
381 | static int hci_uart_register_dev(struct hci_uart *hu) | 378 | static int hci_uart_register_dev(struct hci_uart *hu) |