Skip to contentSkip to conversation

drivers/misc/ti-st: Prefer tty_driver_flush_buffer

PATCH New Peter Hurley 1 participant 1 message Nov 29, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/misc/ti-st: Prefer tty_driver_flush_buffer

The tty core provides an interface for flushing the driver's write buffer: tty_driver_flush_buffer(); prefer the provided interface over open-coded. Open-coding can lead to errors such as the duplicated call in the st_kim driver.

---
 drivers/misc/ti-st/st_core.c | 2 +-
 drivers/misc/ti-st/st_kim.c  | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/misc/ti-st/st_core.c +1 -1
index 8d64b68..3aed525 100644
@@ -812,7 +812,7 @@ static void st_tty_flush_buffer(struct tty_struct *tty)
 	kfree_skb(st_gdata->tx_skb);
 	st_gdata->tx_skb = NULL;
 
-	tty->ops->flush_buffer(tty);
+	tty_driver_flush_buffer(tty);
 	return;
 }
 
drivers/misc/ti-st/st_kim.c +0 -1
index 83907c7..9c14b07 100644
@@ -531,7 +531,6 @@ long st_kim_stop(void *kim_data)
 		/* Flush any pending characters in the driver and discipline. */
 		tty_ldisc_flush(tty);
 		tty_driver_flush_buffer(tty);
-		tty->ops->flush_buffer(tty);
 	}
 
 	/* send uninstall notification to UIM */
Signature · 1 line
1.8.1.2