X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=namedev.c;h=cd1f2de989ea1036319479c3e7374a33d3270e4e;hp=4b3674935aa1671ed39245562222a005cd153077;hb=882af735ec18cb4e6ba6f59ca60f8266cc96c330;hpb=783272f045faf39325678eef0d55a41d7306e2d3 diff --git a/namedev.c b/namedev.c index 4b3674935..cd1f2de98 100644 --- 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");