summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-01-10 14:23:23 +0100
committerKay Sievers <kay@vrfy.org>2013-01-10 14:28:48 +0100
commit1d010426c01044350b2b32d8b3af5d064f7dfe27 (patch)
tree8aeeb575e687597ab9fbf81254f6c60ff6e3496c /src
parent988d77ef2ea05113b54a77ecbd6653e314a9b7d4 (diff)
udev: Fix device matching in the accelerometer
As we were searching by ID_PATH, it would have been possible for us to find a sibling device instead of the device we were looking for. This fixes device matching on the WeTab with the upstream kernel, as it was trying to use the "Asus Laptop extra buttons" device instead of the accelerometer.
Diffstat (limited to 'src')
-rw-r--r--src/udev/accelerometer/accelerometer.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
index 21f51936ee..2fea3889c7 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -257,7 +257,6 @@ int main (int argc, char** argv)
char devpath[PATH_MAX];
char *devnode;
- const char *id_path;
struct udev_enumerate *enumerate;
struct udev_list_entry *list_entry;
@@ -303,18 +302,10 @@ int main (int argc, char** argv)
return 1;
}
- id_path = udev_device_get_property_value(dev, "ID_PATH");
- if (id_path == NULL) {
- fprintf (stderr, "unable to get property ID_PATH for '%s'", devpath);
- return 0;
- }
-
/* Get the children devices and find the devnode */
- /* FIXME: use udev_enumerate_add_match_parent() instead */
devnode = NULL;
enumerate = udev_enumerate_new(udev);
- udev_enumerate_add_match_property(enumerate, "ID_PATH", id_path);
- udev_enumerate_add_match_subsystem(enumerate, "input");
+ udev_enumerate_add_match_parent(enumerate, dev);
udev_enumerate_scan_devices(enumerate);
udev_list_entry_foreach(list_entry, udev_enumerate_get_list_entry(enumerate)) {
struct udev_device *device;