slcan: fix ldisc->open retval

Submitted by Oliver Hartkopp on May 10, 2011, 6:09 a.m.

Details

Message ID 4DC8D681.8000602@hartkopp.net
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Oliver Hartkopp May 10, 2011, 6:09 a.m.
TTY layer expects 0 if the ldisc->open operation succeeded.

Reported-by: Matvejchikov Ilya <matvejchikov@gmail.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

---


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller May 10, 2011, 8:12 p.m.
From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: Tue, 10 May 2011 08:09:05 +0200

> TTY layer expects 0 if the ldisc->open operation succeeded.
> 
> Reported-by: Matvejchikov Ilya <matvejchikov@gmail.com>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch hide | download patch | download mbox

diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index b423965..1b49df6 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -583,7 +583,9 @@  static int slcan_open(struct tty_struct *tty)
 	/* Done.  We have linked the TTY line to a channel. */
 	rtnl_unlock();
 	tty->receive_room = 65536;	/* We don't flow control */
-	return sl->dev->base_addr;
+
+	/* TTY layer expects 0 on success */
+	return 0;
 
 err_free_chan:
 	sl->tty = NULL;