diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-06-18 22:50:55 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-06-18 22:50:55 +0200 |
commit | 325293609392d0feba7a31ca9ed0940c8509c2ea (patch) | |
tree | 956664ea1355af6d206440624588eaaa66ca5cff /libudev/libudev-enumerate.c | |
parent | 6297c2d4e48068685ac810d631291daf75a95ec7 (diff) |
libudev: enumerate - scan /sys/module
Diffstat (limited to 'libudev/libudev-enumerate.c')
-rw-r--r-- | libudev/libudev-enumerate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c index 6e51726f08..0b028bab84 100644 --- a/libudev/libudev-enumerate.c +++ b/libudev/libudev-enumerate.c @@ -814,15 +814,25 @@ UDEV_EXPORT int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enume if (udev_enumerate == NULL) return -EINVAL; + /* all kernel modules */ + if (match_subsystem(udev_enumerate, "module")) { + dbg(udev, "searching '%s/modules/*' dir\n", subsysdir); + scan_dir_and_add_devices(udev_enumerate, "module", NULL, NULL); + } + util_strscpyl(base, sizeof(base), udev_get_sys_path(udev), "/subsystem", NULL); if (stat(base, &statbuf) == 0) subsysdir = "subsystem"; else subsysdir = "bus"; + + /* all subsystems (only buses support coldplug) */ if (match_subsystem(udev_enumerate, "subsystem")) { dbg(udev, "searching '%s/*' dir\n", subsysdir); scan_dir_and_add_devices(udev_enumerate, subsysdir, NULL, NULL); } + + /* all subsystem drivers */ if (match_subsystem(udev_enumerate, "drivers")) { dbg(udev, "searching '%s/*/drivers/*' dir\n", subsysdir); scan_dir(udev_enumerate, subsysdir, "drivers", "drivers"); |