Commit 6a6968a7 authored by Christian Kellner's avatar Christian Kellner
Browse files

device: use host ident for host devices

If a device is a host device, i.e. does not have a parent device, use
the new host identification method, which will transparently fall
back to use the SMBIOS/DMI information, in case the standard
device information is not available, which is the case on embedded
thunderbolt controllers.
parent 290143fb
Pipeline #235822 passed with stage
in 5 minutes and 36 seconds
......@@ -1194,15 +1194,19 @@ bolt_device_new_for_udev (struct udev_device *udev,
if (!ok)
return NULL;
ok = bolt_sysfs_device_ident (udev, &id, error);
if (!ok)
return NULL;
if (info.parent == NULL)
type = BOLT_DEVICE_HOST;
else
type = BOLT_DEVICE_PERIPHERAL;
if (type == BOLT_DEVICE_HOST)
ok = bolt_sysfs_host_ident (udev, &id, error);
else
ok = bolt_sysfs_device_ident (udev, &id, error);
if (!ok)
return NULL;
ct = (guint64) info.ctim;
status = bolt_status_from_info (&info);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment