linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] device: Fix probing service twice
@ 2018-02-19 15:49 Luiz Augusto von Dentz
  2018-02-19 15:49 ` [PATCH BlueZ] shared/shell: Add non-interactive mode Luiz Augusto von Dentz
  2018-02-20 14:58 ` [PATCH BlueZ] device: Fix probing service twice Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2018-02-19 15:49 UTC (permalink / raw)
  To: linux-bluetooth

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

If there is already a service for a given profile there is no point in
probing it again.
---
 src/device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/device.c b/src/device.c
index 1acecce33..0da4184f6 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4202,6 +4202,7 @@ static struct btd_service *probe_service(struct btd_device *device,
 						struct btd_profile *profile,
 						GSList *uuids)
 {
+	GSList *l;
 	struct btd_service *service;
 
 	if (profile->device_probe == NULL)
@@ -4210,6 +4211,10 @@ static struct btd_service *probe_service(struct btd_device *device,
 	if (!device_match_profile(device, profile, uuids))
 		return NULL;
 
+	l = find_service_with_profile(device->services, profile);
+	if (l)
+		return l->data;
+
 	service = service_create(device, profile);
 
 	if (service_probe(service)) {
-- 
2.14.3


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

end of thread, other threads:[~2018-02-20 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-19 15:49 [PATCH BlueZ] device: Fix probing service twice Luiz Augusto von Dentz
2018-02-19 15:49 ` [PATCH BlueZ] shared/shell: Add non-interactive mode Luiz Augusto von Dentz
2018-02-20 14:58 ` [PATCH BlueZ] device: Fix probing service twice 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).