mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-10 01:46:30 +00:00
Speed up daemon startup by 650ms
Reading properties from drm_dp_aux1 and drm_dp_aux2 took 700ms, and we're never going to match any GUIDs as the vendor and model IDs are both unset.
This commit is contained in:
parent
f14e4f8b8d
commit
a7642a7b7e
@ -382,6 +382,10 @@ 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 */
|
/* set the version if the revision has been set */
|
||||||
if (fu_device_get_version(device) == NULL &&
|
if (fu_device_get_version(device) == NULL &&
|
||||||
fu_device_get_version_format(device) == FWUPD_VERSION_FORMAT_UNKNOWN) {
|
fu_device_get_version_format(device) == FWUPD_VERSION_FORMAT_UNKNOWN) {
|
||||||
@ -449,18 +453,16 @@ fu_udev_device_probe(FuDevice *device, GError **error)
|
|||||||
|
|
||||||
/* set vendor ID */
|
/* set vendor ID */
|
||||||
subsystem = g_ascii_strup(g_udev_device_get_subsystem(priv->udev_device), -1);
|
subsystem = g_ascii_strup(g_udev_device_get_subsystem(priv->udev_device), -1);
|
||||||
if (subsystem != NULL && priv->vendor != 0x0000) {
|
if (subsystem != NULL) {
|
||||||
g_autofree gchar *vendor_id = NULL;
|
g_autofree gchar *vendor_id = NULL;
|
||||||
vendor_id = g_strdup_printf("%s:0x%04X", subsystem, (guint)priv->vendor);
|
vendor_id = g_strdup_printf("%s:0x%04X", subsystem, (guint)priv->vendor);
|
||||||
fu_device_add_vendor_id(device, vendor_id);
|
fu_device_add_vendor_id(device, vendor_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add GUIDs in order of priority */
|
/* add GUIDs in order of priority */
|
||||||
if (priv->vendor != 0x0000)
|
fu_device_add_instance_u16(device, "VEN", priv->vendor);
|
||||||
fu_device_add_instance_u16(device, "VEN", priv->vendor);
|
fu_device_add_instance_u16(device, "DEV", priv->model);
|
||||||
if (priv->model != 0x0000)
|
if (priv->subsystem_vendor != 0x0000) {
|
||||||
fu_device_add_instance_u16(device, "DEV", priv->model);
|
|
||||||
if (priv->subsystem_vendor != 0x0000 && priv->subsystem_model != 0x0000) {
|
|
||||||
g_autofree gchar *subsys =
|
g_autofree gchar *subsys =
|
||||||
g_strdup_printf("%04X%04X", priv->subsystem_vendor, priv->subsystem_model);
|
g_strdup_printf("%04X%04X", priv->subsystem_vendor, priv->subsystem_model);
|
||||||
fu_device_add_instance_str(device, "SUBSYS", subsys);
|
fu_device_add_instance_str(device, "SUBSYS", subsys);
|
||||||
|
Loading…
Reference in New Issue
Block a user