linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Return proper error codes on rfcomm tty init
@ 2011-10-24 13:30 David Herrmann
  2011-10-24 13:30 ` [PATCH 2/2] Bluetooth: Replace rfcomm tty tasklet by workqueue David Herrmann
  2011-10-24 13:57 ` [PATCH 1/2] Bluetooth: Return proper error codes on rfcomm tty init Anderson Briglia
  0 siblings, 2 replies; 5+ messages in thread
From: David Herrmann @ 2011-10-24 13:30 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: padovan, David Herrmann

Forward error codes from tty core to the rfcomm_init caller instead of using
generic -1 errors.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
 net/bluetooth/rfcomm/tty.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index c258796..2b753a3 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -1155,9 +1155,11 @@ static const struct tty_operations rfcomm_ops = {
 
 int __init rfcomm_init_ttys(void)
 {
+	int error;
+
 	rfcomm_tty_driver = alloc_tty_driver(RFCOMM_TTY_PORTS);
 	if (!rfcomm_tty_driver)
-		return -1;
+		return -ENOMEM;
 
 	rfcomm_tty_driver->owner	= THIS_MODULE;
 	rfcomm_tty_driver->driver_name	= "rfcomm";
@@ -1172,10 +1174,11 @@ int __init rfcomm_init_ttys(void)
 	rfcomm_tty_driver->init_termios.c_lflag &= ~ICANON;
 	tty_set_operations(rfcomm_tty_driver, &rfcomm_ops);
 
-	if (tty_register_driver(rfcomm_tty_driver)) {
+	error = tty_register_driver(rfcomm_tty_driver);
+	if (error) {
 		BT_ERR("Can't register RFCOMM TTY driver");
 		put_tty_driver(rfcomm_tty_driver);
-		return -1;
+		return error;
 	}
 
 	BT_INFO("RFCOMM TTY layer initialized");
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-31 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 13:30 [PATCH 1/2] Bluetooth: Return proper error codes on rfcomm tty init David Herrmann
2011-10-24 13:30 ` [PATCH 2/2] Bluetooth: Replace rfcomm tty tasklet by workqueue David Herrmann
2011-10-31 19:29   ` Gustavo Padovan
2011-10-24 13:57 ` [PATCH 1/2] Bluetooth: Return proper error codes on rfcomm tty init Anderson Briglia
2011-10-24 14:03   ` David Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).