From 175cb7b81d4e4d2c858bebacbf6b0ee62822afab Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 3 Dec 2009 12:46:22 +0100 Subject: [PATCH] input_id: small optimization In the parent traversal loop, use udev_device_get_parent_with_subsystem_devtype() to only grab "input" class devices. --- extras/input_id/input_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/input_id/input_id.c b/extras/input_id/input_id.c index 802452468..48097aa97 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) -- 2.30.2