summaryrefslogtreecommitdiffstats
path: root/src/adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-11-29 23:26:07 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-11-29 23:26:07 +0200
commit5c4d393d36090d7640a5aa7f9ed2e55b2acc1ef2 (patch)
tree26d0e27fc5d1b2998005f93d693a6e50ec34421c /src/adapter.c
parent2dc1a78776445d1f7c9a59d3e329afaa006f3ade (diff)
Further set_mode cleanup
Use the dedicated adapter_remove_discov_timeout function and don't care about sessions when setting the discoverable timer since sessions can't own the discoverable mode anymore.
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 2bc0eb88..9f8f89f7 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -693,12 +693,8 @@ static int set_mode(struct btd_adapter *adapter, uint8_t new_mode)
} else {
/* discoverable or limited */
if ((scan_enable & SCAN_INQUIRY) && (new_mode != adapter->mode)) {
- if (adapter->discov_timeout_id) {
- g_source_remove(adapter->discov_timeout_id);
- adapter->discov_timeout_id = 0;
- }
-
- if (!adapter->mode_sessions && adapter->discov_timeout)
+ adapter_remove_discov_timeout(adapter);
+ if (adapter->discov_timeout)
adapter_set_discov_timeout(adapter,
adapter->discov_timeout);
}