summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-01-04 08:08:26 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:14 -0700
commit8eb38ef882192445bd0e012351a6192a2968a76c (patch)
tree3cd7ae358a20c5a93fe4d7c6f672a8557deecca4
parente9a8c2e432bc2b419a2bac590d3021f2b736b305 (diff)
[PATCH] add a blacklist of class devices we do not want to look at.
Thanks to Kay for the original patch, and the idea.
-rw-r--r--udev.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/udev.c b/udev.c
index 0d0a5da207..1222b239ef 100644
--- a/udev.c
+++ b/udev.c
@@ -139,12 +139,20 @@ help:
return retval;
}
+static char *subsystem_blacklist[] = {
+ "net",
+ "scsi_host",
+ "scsi_device",
+ "",
+};
+
static inline int udev_hotplug(int argc, char **argv)
{
char *action;
char *devpath;
char *subsystem;
int retval = -EINVAL;
+ int i;
subsystem = argv[1];
@@ -162,10 +170,14 @@ static inline int udev_hotplug(int argc, char **argv)
goto exit;
}
- /* but we don't care about net class devices */
- if (strcmp(subsystem, "net") == 0) {
- dbg("don't care about net devices");
- goto exit;
+ /* skip blacklisted subsystems */
+ i = 0;
+ while (subsystem_blacklist[i][0] != '\0') {
+ if (strcmp(subsystem, subsystem_blacklist[i]) == 0) {
+ dbg("don't care about '%s' devices", subsystem);
+ goto exit;
+ }
+ i++;
}
action = get_action();