diff options
author | Mikel Astiz <mikel.astiz@bmw-carit.de> | 2012-10-26 07:55:29 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-10-26 10:04:21 +0300 |
commit | 79b5c838af6b43a39013134d0f4b1f3362c67326 (patch) | |
tree | 5aee5448ab239d2ee6029c7783868ee2db3b9bcd | |
parent | 58f4c6ef26a8ba9d95393507b366baecc6b5a33c (diff) |
network: Remove unnecessary field from connect_req
The device pointer in struct connect_req can be completely removed since
the callback already receives such pointer, and the network_peer takes
care of the device refcounting.
-rw-r--r-- | profiles/network/manager.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/profiles/network/manager.c b/profiles/network/manager.c index ad528858..8d0dc4d2 100644 --- a/profiles/network/manager.c +++ b/profiles/network/manager.c @@ -48,7 +48,6 @@ static gboolean conf_security = TRUE; struct connect_req { - struct btd_device *device; struct btd_profile *profile; btd_profile_cb cb; }; @@ -84,9 +83,7 @@ static void connect_profile_cb(struct btd_device *device, int err, { struct connect_req *req = data; - req->cb(req->profile, req->device, err); - - btd_device_unref(req->device); + req->cb(req->profile, device, err); g_free(req); } @@ -100,14 +97,12 @@ static int connect_profile(struct btd_device *dev, struct btd_profile *profile, DBG("path %s id %u", device_get_path(dev), id); req = g_new0(struct connect_req, 1); - req->device = btd_device_ref(dev); req->profile = profile; req->cb = cb; err = connection_connect(dev, BNEP_SVC_PANU, NULL, connect_profile_cb, req); if (err < 0) { - btd_device_unref(req->device); g_free(req); return err; } |