-static int compare_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, struct key_pair *pair)
-{
- char value[VALUE_SIZE];
- int i;
-
- if (find_sysfs_attribute(class_dev, sysfs_device, pair->name, value, sizeof(value)) != 0)
- return -1;
-
- /* strip trailing whitespace of value, if not asked to match for it */
- if (!isspace(pair->value[strlen(pair->value)-1])) {
- i = strlen(value);
- while (i > 0 && isspace(value[i-1]))
- value[--i] = '\0';
- dbg("removed %i trailing whitespace chars from '%s'", strlen(value)-i, value);
- }
-
- dbg("compare attribute '%s' value '%s' with '%s'", pair->name, value, pair->value);
- if (strcmp_pattern(pair->value, value) != 0)
- return -1;
-
- dbg("found matching attribute '%s' with value '%s'", pair->name, pair->value);
- return 0;
-}
-