summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2009-12-03 12:46:22 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2009-12-03 12:46:22 +0100
commit175cb7b81d4e4d2c858bebacbf6b0ee62822afab (patch)
tree7de39d08bbe552383369f95150a86b12968f2e47
parentb919e0ffee9356f34da1f94465e7235d30ceb154 (diff)
input_id: small optimization
In the parent traversal loop, use udev_device_get_parent_with_subsystem_devtype() to only grab "input" class devices.
-rw-r--r--extras/input_id/input_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extras/input_id/input_id.c b/extras/input_id/input_id.c
index 8024524681..48097aa977 100644
--- a/extras/input_id/input_id.c
+++ b/extras/input_id/input_id.c
@@ -144,7 +144,7 @@ int main (int argc, char** argv)
/* walk up the parental chain until we find the real input device; the
* argument is very likely a subdevice of this, like eventN */
while (dev != NULL && udev_device_get_sysattr_value(dev, "capabilities/key") == NULL)
- dev = udev_device_get_parent(dev);
+ dev = udev_device_get_parent_with_subsystem_devtype(dev, "input", NULL);
/* not an "input" class device */
if (dev == NULL)