udevadm: info: also show parent devices by --tree

This commit is contained in:
Yu Watanabe
2022-04-14 17:12:10 +09:00
committed by Luca Boccassi
parent ee5b175b8c
commit bd4297e761
4 changed files with 82 additions and 49 deletions

View File

@@ -637,6 +637,13 @@ static int print_tree(sd_device* below) {
if (r < 0)
return log_error_errno(r, "Failed to scan for devices and subsystems: %m");
if (below) {
/* This must be called after device_enumerator_scan_devices_and_subsystems(). */
r = device_enumerator_add_parent_devices(e, below);
if (r < 0)
return log_error_errno(r, "Failed to add parent devices: %m");
}
assert_se(array = device_enumerator_get_devices(e, &n));
if (n == 0) {