diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-06 08:30:00 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-06-06 08:30:00 +0000 |
commit | 8c504bfaf8042b62dc2e3422321f73beef831b0a (patch) | |
tree | 742073b50f3d03c687a2dbbb21041408bb78536d /hcid/adapter.c | |
parent | 866d5e4f7af20b0527efb33188c5f9aaa0bc42e3 (diff) |
Minor cleanup
Diffstat (limited to 'hcid/adapter.c')
-rw-r--r-- | hcid/adapter.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c index 418b32be..09248528 100644 --- a/hcid/adapter.c +++ b/hcid/adapter.c @@ -290,8 +290,10 @@ int pending_remote_name_cancel(struct adapter *adapter) return err; } -static void device_agent_removed(struct agent *agent, struct device *device) +static void device_agent_removed(struct agent *agent, void *user_data) { + struct device *device = user_data; + device->agent = NULL; } @@ -305,17 +307,16 @@ static struct bonding_request_info *bonding_request_new(DBusConnection *conn, struct bonding_request_info *bonding; struct device *device; - if (hcid_dbus_use_experimental()) { + if (hcid_dbus_use_experimental() && agent_path) { device = adapter_get_device(conn, adapter, address); if (!device) return NULL; - if (agent_path) - device->agent = agent_create(adapter, - dbus_message_get_sender(msg), - agent_path, capability, - (agent_remove_cb) device_agent_removed, - device); + device->agent = agent_create(adapter, + dbus_message_get_sender(msg), + agent_path, capability, + device_agent_removed, + device); } bonding = g_new0(struct bonding_request_info, 1); |