Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83510
b: refs/heads/master
c: ee51ef0
h: refs/heads/master
v: v3
  • Loading branch information
Tilman Schmidt authored and Linus Torvalds committed Feb 6, 2008
1 parent 087adbf commit 205edb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e468c04894f36045cf93d1384183a461014b6840
refs/heads/master: ee51ef0ecbb68fdd7beab8f7b0a20eebe6fd0a62
10 changes: 5 additions & 5 deletions trunk/drivers/isdn/gigaset/ser-gigaset.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/platform_device.h>
#include <linux/tty.h>
#include <linux/poll.h>
#include <linux/completion.h>

/* Version Information */
#define DRIVER_AUTHOR "Tilman Schmidt"
Expand Down Expand Up @@ -48,7 +49,7 @@ struct ser_cardstate {
struct platform_device dev;
struct tty_struct *tty;
atomic_t refcnt;
struct mutex dead_mutex;
struct completion dead_cmp;
};

static struct platform_driver device_driver = {
Expand Down Expand Up @@ -498,7 +499,7 @@ static struct cardstate *cs_get(struct tty_struct *tty)
static void cs_put(struct cardstate *cs)
{
if (atomic_dec_and_test(&cs->hw.ser->refcnt))
mutex_unlock(&cs->hw.ser->dead_mutex);
complete(&cs->hw.ser->dead_cmp);
}

/*
Expand Down Expand Up @@ -527,8 +528,8 @@ gigaset_tty_open(struct tty_struct *tty)

cs->dev = &cs->hw.ser->dev.dev;
cs->hw.ser->tty = tty;
mutex_init(&cs->hw.ser->dead_mutex);
atomic_set(&cs->hw.ser->refcnt, 1);
init_completion(&cs->hw.ser->dead_cmp);

tty->disc_data = cs;

Expand All @@ -543,7 +544,6 @@ gigaset_tty_open(struct tty_struct *tty)
}

gig_dbg(DEBUG_INIT, "Startup of HLL done");
mutex_lock(&cs->hw.ser->dead_mutex);
return 0;

error:
Expand Down Expand Up @@ -577,7 +577,7 @@ gigaset_tty_close(struct tty_struct *tty)
else {
/* wait for running methods to finish */
if (!atomic_dec_and_test(&cs->hw.ser->refcnt))
mutex_lock(&cs->hw.ser->dead_mutex);
wait_for_completion(&cs->hw.ser->dead_cmp);
}

/* stop operations */
Expand Down

0 comments on commit 205edb0

Please sign in to comment.