device: Fix not probing drivers at startup
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 9 Aug 2023 19:31:25 +0000 (12:31 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
Patch 67a26abe53bf ("profile: Add probe_on_discover flag") introduced a
regression which prevents drivers to be properly loaded at startup since
at that point they are not connected when code shall testing if
the devide is temporary instead.

src/device.c

index 60f8886..5f92caa 100644 (file)
@@ -6489,10 +6489,10 @@ static bool device_match_profile(struct btd_device *device,
        if (profile->remote_uuid == NULL)
                return false;
 
-       /* Don't match if device was just discovered (not connected) and the
+       /* Don't match if device was just discovered, is temporary, and the
         * profile don't have probe_on_discover flag set.
         */
-       if (!btd_device_is_connected(device) && !profile->probe_on_discover)
+       if (device->temporary && !profile->probe_on_discover)
                return false;
 
        if (g_slist_find_custom(uuids, profile->remote_uuid,