- /* initialize udev database */
- retval = udevdb_init(UDEVDB_DEFAULT);
- if (retval != 0) {
- dbg("unable to initialize database");
- goto exit;
+ if (!devpath) {
+ dbg("no devpath?");
+ goto exit;
+ }
+ dbg("looking at '%s'", devpath);
+
+ /* we only care about class devices and block stuff */
+ if (!strstr(devpath, "class") && !strstr(devpath, "block")) {
+ dbg("not a block or class device");
+ goto exit;
+ }
+
+ if (!subsystem) {
+ dbg("no subsystem");
+ goto exit;
+ }
+
+ udev_set_values(&udev, devpath, subsystem);
+
+ /* skip blacklisted subsystems */
+ if (udev.type != 'n' && subsystem_expect_no_dev(subsystem)) {
+ dbg("don't care about '%s' devices", subsystem);
+ goto exit;
+ };
+