summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
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);