From 325293609392d0feba7a31ca9ed0940c8509c2ea Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 18 Jun 2011 22:50:55 +0200 Subject: [PATCH] libudev: enumerate - scan /sys/module --- Makefile.am | 2 +- libudev/libudev-enumerate.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 3ea96df9..0ca351c8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -42,7 +42,7 @@ dist_libexec_SCRIPTS = # libudev # ------------------------------------------------------------------------------ LIBUDEV_CURRENT=11 -LIBUDEV_REVISION=5 +LIBUDEV_REVISION=6 LIBUDEV_AGE=11 SUBDIRS += libudev/docs diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c index 6e51726f..0b028bab 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"); -- 2.39.5