diff options
-rw-r--r-- | drivers/isdn/mISDN/core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c index 9426c9827e47..21d34be5af6a 100644 --- a/drivers/isdn/mISDN/core.c +++ b/drivers/isdn/mISDN/core.c @@ -214,7 +214,7 @@ get_free_devid(void) if (!test_and_set_bit(i, (u_long *)&device_ids)) break; if (i > MAX_DEVICE_ID) - return -1; + return -EBUSY; return i; } @@ -224,10 +224,10 @@ mISDN_register_device(struct mISDNdevice *dev, { int err; - dev->id = get_free_devid(); - err = -EBUSY; - if (dev->id < 0) + err = get_free_devid(); + if (err < 0) goto error1; + dev->id = err; device_initialize(&dev->dev); if (name && name[0]) |