Use the UDev devtype for quirk matching

This commit is contained in:
Richard Hughes 2021-12-30 10:51:53 +00:00
parent 0c447b3c47
commit 736a56ccee
2 changed files with 13 additions and 2 deletions

View File

@ -509,6 +509,15 @@ fu_udev_device_probe(FuDevice *device, GError **error)
fu_device_add_instance_id_full(device, devid, FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS);
}
/* add devtype */
tmp = g_udev_device_get_devtype(priv->udev_device);
if (tmp != NULL) {
g_autofree gchar *devtype = g_utf8_strup(tmp, -1);
g_autofree gchar *devid = NULL;
devid = g_strdup_printf("%s\\TYPE_%s", subsystem, devtype);
fu_device_add_instance_id_full(device, devid, FU_DEVICE_INSTANCE_FLAG_ONLY_QUIRKS);
}
/* add the driver */
if (priv->driver != NULL) {
g_autofree gchar *devid = NULL;

View File

@ -1,3 +1,5 @@
# match all devices with this udev subsystem
[THUNDERBOLT]
[THUNDERBOLT\TYPE_THUNDERBOLT_DEVICE]
Plugin = thunderbolt
[THUNDERBOLT\TYPE_THUNDERBOLT_RETIMER]
Plugin = thunderbolt