linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Fix creating device object when connection fails
@ 2011-01-31 12:56 Luiz Augusto von Dentz
  2011-01-31 12:56 ` [PATCH 2/2] Fix creating device object when device disconnects Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-01-31 12:56 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

There is no need to create a new object since there is no connection and
the device is not permanent/paired.
---
 src/event.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/event.c b/src/event.c
index ff768c0..166e401 100644
--- a/src/event.c
+++ b/src/event.c
@@ -676,7 +676,9 @@ void btd_event_conn_failed(bdaddr_t *local, bdaddr_t *peer, uint8_t status)
 	struct btd_device *device;
 	DBusConnection *conn = get_dbus_connection();
 
-	if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
+	DBG("");
+
+	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
 		return;
 
 	if (device_is_temporary(device))
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] Fix creating device object when device disconnects
  2011-01-31 12:56 [PATCH 1/2] Fix creating device object when connection fails Luiz Augusto von Dentz
@ 2011-01-31 12:56 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2011-01-31 12:56 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

If object doesn't exist the device is not permanent so there is no need
to create a new object just to handle disconnect event.
---
 src/event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/event.c b/src/event.c
index 166e401..5060e84 100644
--- a/src/event.c
+++ b/src/event.c
@@ -692,7 +692,7 @@ void btd_event_disconn_complete(bdaddr_t *local, bdaddr_t *peer)
 
 	DBG("");
 
-	if (!get_adapter_and_device(local, peer, &adapter, &device, TRUE))
+	if (!get_adapter_and_device(local, peer, &adapter, &device, FALSE))
 		return;
 
 	adapter_remove_connection(adapter, device);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-31 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-31 12:56 [PATCH 1/2] Fix creating device object when connection fails Luiz Augusto von Dentz
2011-01-31 12:56 ` [PATCH 2/2] Fix creating device object when device disconnects Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).