mISDN: Correct busy device detection
[firefly-linux-kernel-4.4.55.git] / drivers / isdn / mISDN / stack.c
index 9b9fab47cb2b688cb716ecf675ee5d69d09d006e..e2f45019ebf0be504bdcd68538cd47f51109c588 100644 (file)
@@ -440,22 +440,14 @@ connect_layer1(struct mISDNdevice *dev, struct mISDNchannel *ch,
        case ISDN_P_NT_E1:
        case ISDN_P_TE_S0:
        case ISDN_P_TE_E1:
-#ifdef PROTOCOL_CHECK
-               /* this should be enhanced */
-               if (!list_empty(&dev->D.st->layer2)
-                       && dev->D.protocol != protocol)
-                       return -EBUSY;
-               if (!hlist_empty(&dev->D.st->l1sock.head)
-                       && dev->D.protocol != protocol)
-                       return -EBUSY;
-#endif
                ch->recv = mISDN_queue_message;
                ch->peer = &dev->D.st->own;
                ch->st = dev->D.st;
                rq.protocol = protocol;
-               rq.adr.channel = 0;
+               rq.adr.channel = adr->channel;
                err = dev->D.ctrl(&dev->D, OPEN_CHANNEL, &rq);
-               printk(KERN_DEBUG "%s: ret 1 %d\n", __func__, err);
+               printk(KERN_DEBUG "%s: ret %d (dev %d)\n", __func__, err,
+                       dev->id);
                if (err)
                        return err;
                write_lock_bh(&dev->D.st->l1sock.lock);
@@ -546,15 +538,6 @@ create_l2entity(struct mISDNdevice *dev, struct mISDNchannel *ch,
                if (dev->Dprotocols & (1 << ISDN_P_NT_E1))
                        rq.protocol = ISDN_P_NT_E1;
        case ISDN_P_LAPD_TE:
-#ifdef PROTOCOL_CHECK
-               /* this should be enhanced */
-               if (!list_empty(&dev->D.st->layer2)
-                       && dev->D.protocol != protocol)
-                       return -EBUSY;
-               if (!hlist_empty(&dev->D.st->l1sock.head)
-                       && dev->D.protocol != protocol)
-                       return -EBUSY;
-#endif
                ch->recv = mISDN_queue_message;
                ch->peer = &dev->D.st->own;
                ch->st = dev->D.st;