chiark / gitweb /
[PATCH] remove PLACE key match
[elogind.git] / namedev.c
index 4b3674935aa1671ed39245562222a005cd153077..cd1f2de989ea1036319479c3e7374a33d3270e4e 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -531,28 +531,6 @@ static int match_id(struct config_device *dev, struct sysfs_device *sysfs_device
        return 0;
 }
 
-static int match_place(struct config_device *dev, struct sysfs_device *sysfs_device)
-{
-       char path[PATH_SIZE];
-       char *temp;
-
-       strlcpy(path, sysfs_device->path, sizeof(path));
-       temp = strrchr(path, '/');
-       dbg("search '%s' in '%s', path='%s'", dev->place, temp, path);
-       if (strstr(temp, dev->place) != NULL)
-               return 0;
-
-       /* try the parent */
-       temp[0] = '\0';
-       temp = strrchr(path, '/');
-       dbg("search '%s' in '%s', path='%s'", dev->place, temp, path);
-       if (strstr(temp, dev->place) == NULL)
-               return 0;
-
-       dbg("place doesn't match");
-       return -ENODEV;
-}
-
 static int match_rule(struct udevice *udev, struct config_device *dev,
                      struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
 {
@@ -622,20 +600,6 @@ static int match_rule(struct udevice *udev, struct config_device *dev,
                        dbg(FIELD_ID " matches");
                }
 
-               /* check for matching place of device */
-               if (dev->place[0] != '\0') {
-                       if (sysfs_device == NULL) {
-                               dbg("device has no sysfs_device");
-                               goto try_parent;
-                       }
-                       dbg("check " FIELD_PLACE);
-                       if (match_place(dev, sysfs_device) != 0) {
-                               dbg(FIELD_PLACE " is not matching");
-                               goto try_parent;
-                       }
-                       dbg(FIELD_PLACE " matches");
-               }
-
                /* check for matching sysfs pairs */
                if (dev->sysfs_pair[0].file[0] != '\0') {
                        dbg("check " FIELD_SYSFS " pairs");