chiark / gitweb /
remove MODALIAS key and substitution
authorKay Sievers <kay.sievers@suse.de>
Wed, 7 Jun 2006 14:00:34 +0000 (16:00 +0200)
committerKay Sievers <kay.sievers@suse.de>
Wed, 7 Jun 2006 14:00:34 +0000 (16:00 +0200)
TODO
udev_rules.c
udev_rules.h
udev_rules_parse.c

diff --git a/TODO b/TODO
index 719f345a0ee20c7914171af6975ac27e590be405..ba12632374a949040db63c83050f21c2ebd441a4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,9 +10,6 @@ udev version:
   o remove broken %e enumeration
     (simple enumerations can't work and should go)
 
   o remove broken %e enumeration
     (simple enumerations can't work and should go)
 
-  o remove MODALIAS + $modalias
-    (ENV{MODALIAS}, $env{MODALIAS}, $sysfs{modalias} will do it)
-
   o remove udevstart
     (we rely on the kernel "uevent" triggers of kernel 2.6.15 and no longer
      want to guess event properties from sysfs like udevstart is doing it)
   o remove udevstart
     (we rely on the kernel "uevent" triggers of kernel 2.6.15 and no longer
      want to guess event properties from sysfs like udevstart is doing it)
index ee4632513acd317a6f1d3e357005311d8864f2bf..03b3f2a1165de1910354677eb9522047b7f49bf6 100644 (file)
@@ -401,7 +401,6 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
                SUBST_PARENT,
                SUBST_TEMP_NODE,
                SUBST_ROOT,
                SUBST_PARENT,
                SUBST_TEMP_NODE,
                SUBST_ROOT,
-               SUBST_MODALIAS,
                SUBST_ENV,
        };
        static const struct subst_map {
                SUBST_ENV,
        };
        static const struct subst_map {
@@ -421,7 +420,6 @@ void udev_rules_apply_format(struct udevice *udev, char *string, size_t maxsize)
                { .name = "parent",             .fmt = 'P',     .type = SUBST_PARENT },
                { .name = "tempnode",           .fmt = 'N',     .type = SUBST_TEMP_NODE },
                { .name = "root",               .fmt = 'r',     .type = SUBST_ROOT },
                { .name = "parent",             .fmt = 'P',     .type = SUBST_PARENT },
                { .name = "tempnode",           .fmt = 'N',     .type = SUBST_TEMP_NODE },
                { .name = "root",               .fmt = 'r',     .type = SUBST_ROOT },
-               { .name = "modalias",           .fmt = 'A',     .type = SUBST_MODALIAS },
                { .name = "env",                .fmt = 'E',     .type = SUBST_ENV },
                { NULL, '\0', 0 }
        };
                { .name = "env",                .fmt = 'E',     .type = SUBST_ENV },
                { NULL, '\0', 0 }
        };
@@ -618,24 +616,6 @@ found:
                        strlcat(string, udev_root, maxsize);
                        dbg("substitute udev_root '%s'", udev_root);
                        break;
                        strlcat(string, udev_root, maxsize);
                        dbg("substitute udev_root '%s'", udev_root);
                        break;
-               case SUBST_MODALIAS:
-                       {
-                               const char *value;
-                               static int warn = 1;
-
-                               if (warn) {
-                                       err("$modalias is deprecated, use $env{MODALIAS} or "
-                                           "$sysfs{modalias} instead.");
-                                       warn = 0;
-                               }
-
-                               value = sysfs_attr_get_value(udev->dev->devpath, "modalias");
-                               if (value != NULL) {
-                                       strlcat(string, value, maxsize);
-                                       dbg("substitute MODALIAS '%s'", temp2);
-                               }
-                       }
-                       break;
                case SUBST_ENV:
                        if (attr == NULL) {
                                dbg("missing attribute");
                case SUBST_ENV:
                        if (attr == NULL) {
                                dbg("missing attribute");
@@ -730,24 +710,6 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule)
        if (match_key("NAME", rule, &rule->name, udev->name))
                goto nomatch;
 
        if (match_key("NAME", rule, &rule->name, udev->name))
                goto nomatch;
 
-       if (rule->modalias.operation != KEY_OP_UNSET) {
-               const char *value;
-               static int warn = 1;
-
-               if (warn) {
-                       err("MODALIAS is deprecated, use ENV{MODALIAS} or SYSFS{modalias} instead.");
-                       warn = 0;
-               }
-
-               value = sysfs_attr_get_value(udev->dev->devpath, "modalias");
-               if (value == NULL) {
-                       dbg("MODALIAS value not found");
-                       goto nomatch;
-               }
-               if (match_key("MODALIAS", rule, &rule->modalias, value))
-                       goto nomatch;
-       }
-
        for (i = 0; i < rule->env.count; i++) {
                struct key_pair *pair = &rule->env.keys[i];
 
        for (i = 0; i < rule->env.count; i++) {
                struct key_pair *pair = &rule->env.keys[i];
 
index e4d5ebd765dbfe3deb088cbfbb3048132b94500d..2c956fccccef3c9f2d48727baf6aa826eac5b2f4 100644 (file)
@@ -71,7 +71,6 @@ struct udev_rule {
        struct key driver;
        struct key program;
        struct key result;
        struct key driver;
        struct key program;
        struct key result;
-       struct key modalias;
        struct key import;
        enum import_type import_type;
        struct key wait_for_sysfs;
        struct key import;
        enum import_type import_type;
        struct key wait_for_sysfs;
index 91cc9744fb6cb044e643a62906dbbd9cd628395b..271de6f87968c4d8aa897e592248a9d6cf830944 100644 (file)
@@ -374,12 +374,6 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
                        continue;
                }
 
                        continue;
                }
 
-               if (strcasecmp(key, "MODALIAS") == 0) {
-                       add_rule_key(rule, &rule->modalias, operation, value);
-                       valid = 1;
-                       continue;
-               }
-
                if (strncasecmp(key, "IMPORT", sizeof("IMPORT")-1) == 0) {
                        attr = get_key_attribute(key + sizeof("IMPORT")-1);
                        if (attr && strstr(attr, "program")) {
                if (strncasecmp(key, "IMPORT", sizeof("IMPORT")-1) == 0) {
                        attr = get_key_attribute(key + sizeof("IMPORT")-1);
                        if (attr && strstr(attr, "program")) {