+ char base[PATH_SIZE];
+ struct stat statbuf;
+
+ /* if we have /sys/subsystem, forget all the old stuff */
+ strlcpy(base, sysfs_path, sizeof(base));
+ strlcat(base, "/subsystem", sizeof(base));
+ if (stat(base, &statbuf) == 0)
+ scan_subsystem("subsystem");
+ else {
+ scan_subsystem("bus");
+ scan_class();
+
+ /* scan "block" if it isn't a "class" */
+ strlcpy(base, sysfs_path, sizeof(base));
+ strlcat(base, "/class/block", sizeof(base));
+ if (stat(base, &statbuf) != 0)
+ scan_block();
+ }