summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-08-28 08:55:00 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-08-28 08:55:00 +0000
commitb72f1302fa22e420431356a61a80f5f045f75c97 (patch)
treeeab6f0df52c5d812ae22b177a9dc56e7772f23b6
parent4327a133c205d5fbeb3a823f62d2f6fa3cc73279 (diff)
headset_unlock: only disconnect if necessary
-rw-r--r--audio/headset.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/headset.c b/audio/headset.c
index bcaa4912..0ccd9d2e 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1589,7 +1589,8 @@ gboolean headset_unlock(struct device *dev, void *data)
hs->locked = FALSE;
- headset_set_state(dev, HEADSET_STATE_DISCONNECTED);
+ if (hs->state > HEADSET_STATE_DISCONNECTED)
+ headset_set_state(dev, HEADSET_STATE_DISCONNECTED);
return TRUE;
}