summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-01-30 14:54:02 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-01-30 14:54:02 +0000
commit55491213b2bdb7c46c330b4515afbed58d77b22b (patch)
tree3ac36e133fea2acdb5a4fcbd6481192c314531bf /hcid/dbus-adapter.c
parent885f18159e513ed1df4088918ea86b05555810e3 (diff)
More SetMode cleanup
Diffstat (limited to 'hcid/dbus-adapter.c')
-rw-r--r--hcid/dbus-adapter.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index a7dce984..2fec2542 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -428,9 +428,6 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn,
(hcid.offmode == HCID_OFFMODE_NOSCAN ||
(hcid.offmode == HCID_OFFMODE_DEVDOWN &&
hci_mode != SCAN_DISABLED))) {
- /* The new value will be loaded when the adapter comes UP */
- write_device_mode(&local, scan_mode);
-
/* Start HCI device */
if (ioctl(dd, HCIDEVUP, adapter->dev_id) == 0)
goto done; /* on success */
@@ -452,8 +449,6 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn,
return error_failed(conn, msg, errno);
}
- write_device_mode(&local, scan_mode);
-
goto done;
}
@@ -485,11 +480,11 @@ static DBusHandlerResult adapter_set_mode(DBusConnection *conn,
hci_close_dev(dd);
return error_failed(conn, msg, bt_error(status));
}
-
- write_device_mode(&local, scan_mode);
}
done:
+ write_device_mode(&local, scan_mode);
+
hci_close_dev(dd);
reply = dbus_message_new_method_return(msg);