chiark / gitweb /
exclude parent devices from DRIVER== match
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 1 Feb 2007 19:23:41 +0000 (20:23 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 1 Feb 2007 19:23:41 +0000 (20:23 +0100)
We have DRIVERS= for this.

RELEASE-NOTES
udev_rules_parse.c

index e3aeb68f3e3fafbe9afb1f65f8d7691c4cc60ff2..39abb7262c69f318b71e803c717ca14436c83795 100644 (file)
@@ -1,3 +1,9 @@
+udev 105
+========
+Bugfixes. DRIVER== will match only for devices that actually have
+a driver. DRIVERS== must be used, to include the parent devices
+in the match.
+
 udev 104
 ========
 Bugfixes.
index 3f7e43f83943f9807dab969e9277fd981814e121..00b53285faf7796bce19e14d1b792a376955046b 100644 (file)
@@ -307,15 +307,7 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                }
 
                if (strcasecmp(key, "DRIVER") == 0) {
-                       if (operation != KEY_OP_MATCH &&
-                           operation != KEY_OP_NOMATCH) {
-                               err("invalid DRIVER operation");
-                               goto invalid;
-                       }
-                       err("DRIVER== will change in a future relase, "
-                           "please use DRIVERS== in %s:%u", filename, lineno);
-                       /* FIXME: this should be rule->driver to match only the event device */
-                       add_rule_key(rule, &rule->drivers, operation, value);
+                       add_rule_key(rule, &rule->driver, operation, value);
                        valid = 1;
                        continue;
                }
@@ -369,6 +361,11 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
 
                if (strncasecmp(key, "ATTRS{", sizeof("ATTRS{")-1) == 0 ||
                    strncasecmp(key, "SYSFS{", sizeof("SYSFS{")-1) == 0) {
+                       if (operation != KEY_OP_MATCH &&
+                           operation != KEY_OP_NOMATCH) {
+                               err("invalid ATTRS operation");
+                               goto invalid;
+                       }
                        attr = get_key_attribute(key + sizeof("ATTRS")-1);
                        if (attr == NULL) {
                                err("error parsing ATTRS attribute");