From: Kay Sievers Date: Wed, 7 Jun 2006 14:00:34 +0000 (+0200) Subject: remove MODALIAS key and substitution X-Git-Tag: 174~2249 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=891205121395acbe84eb6173670ce7934cd9b1c6;ds=sidebyside remove MODALIAS key and substitution --- diff --git a/TODO b/TODO index 719f345a0..ba1263237 100644 --- 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 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) diff --git a/udev_rules.c b/udev_rules.c index ee4632513..03b3f2a11 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -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_MODALIAS, 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 = "modalias", .fmt = 'A', .type = SUBST_MODALIAS }, { .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; - 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"); @@ -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 (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]; diff --git a/udev_rules.h b/udev_rules.h index e4d5ebd76..2c956fccc 100644 --- a/udev_rules.h +++ b/udev_rules.h @@ -71,7 +71,6 @@ struct udev_rule { 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; diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 91cc9744f..271de6f87 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -374,12 +374,6 @@ static int add_to_rules(struct udev_rules *rules, char *line, const char *filena 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")) {