diff options
Diffstat (limited to 'drivers/isdn/gigaset/interface.c')
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index eb50f3dab5f7..f4731c9984f6 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c | |||
@@ -28,12 +28,11 @@ static int if_lock(struct cardstate *cs, int *arg) | |||
28 | return -EINVAL; | 28 | return -EINVAL; |
29 | 29 | ||
30 | if (cmd < 0) { | 30 | if (cmd < 0) { |
31 | *arg = atomic_read(&cs->mstate) == MS_LOCKED; //FIXME remove? | 31 | *arg = cs->mstate == MS_LOCKED; |
32 | return 0; | 32 | return 0; |
33 | } | 33 | } |
34 | 34 | ||
35 | if (!cmd && atomic_read(&cs->mstate) == MS_LOCKED | 35 | if (!cmd && cs->mstate == MS_LOCKED && cs->connected) { |
36 | && cs->connected) { | ||
37 | cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS); | 36 | cs->ops->set_modem_ctrl(cs, 0, TIOCM_DTR|TIOCM_RTS); |
38 | cs->ops->baud_rate(cs, B115200); | 37 | cs->ops->baud_rate(cs, B115200); |
39 | cs->ops->set_line_ctrl(cs, CS8); | 38 | cs->ops->set_line_ctrl(cs, CS8); |
@@ -104,7 +103,7 @@ static int if_config(struct cardstate *cs, int *arg) | |||
104 | if (*arg != 1) | 103 | if (*arg != 1) |
105 | return -EINVAL; | 104 | return -EINVAL; |
106 | 105 | ||
107 | if (atomic_read(&cs->mstate) != MS_LOCKED) | 106 | if (cs->mstate != MS_LOCKED) |
108 | return -EBUSY; | 107 | return -EBUSY; |
109 | 108 | ||
110 | if (!cs->connected) { | 109 | if (!cs->connected) { |
@@ -364,7 +363,7 @@ static int if_write(struct tty_struct *tty, const unsigned char *buf, int count) | |||
364 | 363 | ||
365 | if (!cs->open_count) | 364 | if (!cs->open_count) |
366 | warn("%s: device not opened", __func__); | 365 | warn("%s: device not opened", __func__); |
367 | else if (atomic_read(&cs->mstate) != MS_LOCKED) { | 366 | else if (cs->mstate != MS_LOCKED) { |
368 | warn("can't write to unlocked device"); | 367 | warn("can't write to unlocked device"); |
369 | retval = -EBUSY; | 368 | retval = -EBUSY; |
370 | } else if (!cs->connected) { | 369 | } else if (!cs->connected) { |
@@ -398,9 +397,9 @@ static int if_write_room(struct tty_struct *tty) | |||
398 | 397 | ||
399 | if (!cs->open_count) | 398 | if (!cs->open_count) |
400 | warn("%s: device not opened", __func__); | 399 | warn("%s: device not opened", __func__); |
401 | else if (atomic_read(&cs->mstate) != MS_LOCKED) { | 400 | else if (cs->mstate != MS_LOCKED) { |
402 | warn("can't write to unlocked device"); | 401 | warn("can't write to unlocked device"); |
403 | retval = -EBUSY; //FIXME | 402 | retval = -EBUSY; |
404 | } else if (!cs->connected) { | 403 | } else if (!cs->connected) { |
405 | gig_dbg(DEBUG_ANY, "can't write to unplugged device"); | 404 | gig_dbg(DEBUG_ANY, "can't write to unplugged device"); |
406 | retval = -EBUSY; //FIXME | 405 | retval = -EBUSY; //FIXME |
@@ -430,7 +429,7 @@ static int if_chars_in_buffer(struct tty_struct *tty) | |||
430 | 429 | ||
431 | if (!cs->open_count) | 430 | if (!cs->open_count) |
432 | warn("%s: device not opened", __func__); | 431 | warn("%s: device not opened", __func__); |
433 | else if (atomic_read(&cs->mstate) != MS_LOCKED) { | 432 | else if (cs->mstate != MS_LOCKED) { |
434 | warn("can't write to unlocked device"); | 433 | warn("can't write to unlocked device"); |
435 | retval = -EBUSY; | 434 | retval = -EBUSY; |
436 | } else if (!cs->connected) { | 435 | } else if (!cs->connected) { |