summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-12 06:52:55 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 22:25:38 -0700
commit6818c51d7abeab9914eb7193968b1efa9459a853 (patch)
treef05af9087f42f67bff00f71778cf3f9dc80323b1 /namedev.c
parent02fa9ae58920b431bc37182716dd863f1c482651 (diff)
[PATCH] support SUBSYSTEM as a rule key
This should make it easier to catch e.g all block or net devices with a single rule.
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/namedev.c b/namedev.c
index 3ab45d4ec6..8bf3c0e73e 100644
--- a/namedev.c
+++ b/namedev.c
@@ -604,7 +604,7 @@ static int match_rule(struct config_device *dev, struct sysfs_class_device *clas
}
}
- /* check for matching kernel name*/
+ /* check for matching kernel name */
if (dev->kernel[0] != '\0') {
dbg("check for " FIELD_KERNEL " dev->kernel='%s' class_dev->name='%s'", dev->kernel, class_dev->name);
if (strcmp_pattern(dev->kernel, class_dev->name) != 0) {
@@ -615,6 +615,17 @@ static int match_rule(struct config_device *dev, struct sysfs_class_device *clas
}
}
+ /* check for matching subsystem */
+ if (dev->subsystem[0] != '\0') {
+ dbg("check for " FIELD_SUBSYSTEM " dev->subsystem='%s' class_dev->name='%s'", dev->subsystem, class_dev->name);
+ if (strcmp_pattern(dev->subsystem, udev->subsystem) != 0) {
+ dbg(FIELD_SUBSYSTEM " is not matching");
+ goto try_parent;
+ } else {
+ dbg(FIELD_SUBSYSTEM " matches");
+ }
+ }
+
/* check for matching bus id */
if (dev->id[0] != '\0') {
dbg("check " FIELD_ID);