From 165ce50614c20ac5ce255577f73b5b7a78454899 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 7 Jun 2022 19:11:57 +0100 Subject: [PATCH] Revert "Speed up daemon startup by 650ms" This reverts commit a7642a7b7e8a63b17b38523857e185b3be6ae975. I forgot that we need the TYPE, DRIVER and most importantly subsystem for PossiblePlugin quirk matches. We need something more subtle. --- libfwupdplugin/fu-udev-device.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/libfwupdplugin/fu-udev-device.c b/libfwupdplugin/fu-udev-device.c index 81991c5a8..6362940a3 100644 --- a/libfwupdplugin/fu-udev-device.c +++ b/libfwupdplugin/fu-udev-device.c @@ -382,10 +382,6 @@ fu_udev_device_probe(FuDevice *device, GError **error) } } - /* no instance IDs are going to match */ - if (priv->vendor == 0x0000 || priv->model == 0x0000) - return TRUE; - /* set the version if the revision has been set */ if (fu_device_get_version(device) == NULL && fu_device_get_version_format(device) == FWUPD_VERSION_FORMAT_UNKNOWN) { @@ -453,16 +449,18 @@ fu_udev_device_probe(FuDevice *device, GError **error) /* set vendor ID */ subsystem = g_ascii_strup(g_udev_device_get_subsystem(priv->udev_device), -1); - if (subsystem != NULL) { + if (subsystem != NULL && priv->vendor != 0x0000) { g_autofree gchar *vendor_id = NULL; vendor_id = g_strdup_printf("%s:0x%04X", subsystem, (guint)priv->vendor); fu_device_add_vendor_id(device, vendor_id); } /* add GUIDs in order of priority */ - fu_device_add_instance_u16(device, "VEN", priv->vendor); - fu_device_add_instance_u16(device, "DEV", priv->model); - if (priv->subsystem_vendor != 0x0000) { + if (priv->vendor != 0x0000) + fu_device_add_instance_u16(device, "VEN", priv->vendor); + if (priv->model != 0x0000) + fu_device_add_instance_u16(device, "DEV", priv->model); + if (priv->subsystem_vendor != 0x0000 && priv->subsystem_model != 0x0000) { g_autofree gchar *subsys = g_strdup_printf("%04X%04X", priv->subsystem_vendor, priv->subsystem_model); fu_device_add_instance_str(device, "SUBSYS", subsys);