From 175cb7b81d4e4d2c858bebacbf6b0ee62822afab Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 3 Dec 2009 12:46:22 +0100 Subject: 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(-) (limited to 'extras') 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) -- cgit v1.2.3-54-g00ecf