}
#endif
-#define WAIT_MAX_SECONDS 10
+#define WAIT_MAX_SECONDS 5
#define WAIT_LOOP_PER_SECOND 20
/* wait for specific file to show up, normally the "dev"-file */
{ .subsystem = "net", .file = "ifindex" },
{ .subsystem = "scsi_host", .file = "unique_id" },
{ .subsystem = "scsi_device", .file = NULL },
- { .subsystem = "pcmcia_socket", .file = NULL }, /* all files are unreadable in empty slot :( */
+ { .subsystem = "pcmcia_socket", .file = "card_type" },
{ .subsystem = "usb_host", .file = NULL },
{ .subsystem = "bluetooth", .file = "address" },
{ .subsystem = "firmware", .file = "data" },
break;
}
}
- dbg("looking at class '%s' for specific file '%s'", class_dev->classname, file);
+
+ dbg("looking at class '%s' for specific file '%s'", class_dev->classname, class_dev->path);
loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND;
while (--loop) {
- if (sysfs_get_classdev_attr(class_dev, file) != NULL) {
+ struct stat stats;
+
+ if (stat(class_dev->path, &stats) == 0) {
dbg("class '%s' specific file '%s' found", class_dev->classname, file);
return 0;
}