]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
slcan: Revert SVN commit r1170 (SWTC char hack), as it is superfluous.
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 17 Nov 2010 18:23:18 +0000 (18:23 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 17 Nov 2010 18:23:18 +0000 (18:23 +0000)
https://lists.berlios.de/pipermail/socketcan-users/2010-November/001652.html

git-svn-id: svn://svn.berlios.de//socketcan/trunk@1205 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/drivers/net/can/slcan.c

index 3a30a6b67d2a917cd776320bef1fa430fc4f84b2..b31182437895fe00c74600f23ee5711b7ebedf5d 100644 (file)
@@ -623,7 +623,7 @@ static void slc_sync(void)
 
 
 /* Find a free SLCAN channel, and link in this `tty' line. */
-static struct slcan *slc_alloc(dev_t line, char forcednum)
+static struct slcan *slc_alloc(dev_t line)
 {
        int i;
        int sel = -1;
@@ -677,18 +677,10 @@ static struct slcan *slc_alloc(dev_t line, char forcednum)
                }
        }
 
-       /* Check if the user specified an exact interface to use */
-       if (forcednum) {
-               sel = forcednum - '0';
-               score = 0;
-               i = sel;
-               dev = slcan_devs[i];
-       }
-
        if (sel >= 0) {
                i = sel;
                dev = slcan_devs[i];
-               if ((score > 1) && (dev)) {
+               if (score > 1) {
                        sl = netdev_priv(dev);
                        sl->flags &= (1 << SLF_INUSE);
                        return sl;
@@ -770,21 +762,7 @@ static int slcan_open(struct tty_struct *tty)
 
        /* OK.  Find a free SLCAN channel to use. */
        err = -ENFILE;
-
-       /* Look to see if the user has requested a specific channel
-        * to be used (encoded as '0' plus the interface number requested in
-        * the otherwise unused swtch termios variable )
-        * stty swtch 'channel' device
-        *  where 'channel' is '0' to maxdevs (0)
-        *  where device is the name of the serial device (/dev/ttyUSB0)
-        */
-       if ((SWTC_CHAR(tty)>='0') && (SWTC_CHAR(tty)<'0'+maxdev)){
-               sl = slc_alloc(tty_devnum(tty),SWTC_CHAR(tty));
-       } else {
-               /* OK.  Find a free SLCAN channel to use. */
-               sl = slc_alloc(tty_devnum(tty),0);
-       }
-
+       sl = slc_alloc(tty_devnum(tty));
        if (sl == NULL)
                goto err_exit;