diff options
author | Benjamin Berg <bberg@redhat.com> | 2022-05-17 10:16:03 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2022-05-17 10:23:52 +0200 |
commit | c2b7a53e7162335a60a0cf96e86a14a14a0dcd36 (patch) | |
tree | 415a7d3cdff7f44dbde321394b62008ffd7bb5c0 | |
parent | 6db0627aaa611006913fe03ff7e9ed7e9bd8a281 (diff) | |
download | upower-c2b7a53e7162335a60a0cf96e86a14a14a0dcd36.tar.gz |
linux: Track only first level of "input" entries for sibling matching
There is no need to track the children, as we'll already have the parent
in the lookup table and the parent will already have the correct tags.
-rw-r--r-- | src/linux/up-enumerator-udev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/linux/up-enumerator-udev.c b/src/linux/up-enumerator-udev.c index 6e3cf39..e4a33aa 100644 --- a/src/linux/up-enumerator-udev.c +++ b/src/linux/up-enumerator-udev.c @@ -53,13 +53,14 @@ device_parent_id (GUdevDevice *dev) subsystem = g_udev_device_get_subsystem (parent); - /* Refusing using certain subsystems as parents. */ - if (g_strcmp0 (subsystem, "platform") == 0) + /* Refusing using certain subsystems as parents. + * In particular, refuse input as we'll already insert that parent. */ + if (g_strcmp0 (subsystem, "platform") == 0 || + g_strcmp0 (subsystem, "input") == 0) return NULL; - /* Continue walk if the parent is a "hid" or "input" device */ - if (g_strcmp0 (subsystem, "hid") == 0 || - g_strcmp0 (subsystem, "input") == 0) + /* Continue walk if the parent is a "hid" device */ + if (g_strcmp0 (subsystem, "hid") == 0) return device_parent_id (parent); /* Also skip over USB interfaces, we care about full devices */ |