chiark / gitweb /
fix the fix and change the file to wait for to the "bus" link
authorKay Sievers <kay.sievers@suse.de>
Wed, 22 Jun 2005 00:11:59 +0000 (02:11 +0200)
committerKay Sievers <kay.sievers@suse.de>
Wed, 22 Jun 2005 00:11:59 +0000 (02:11 +0200)
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
udev.c
udev_sysfs.c
udev_sysfs.h

diff --git a/udev.c b/udev.c
index 67d081d..36ff21d 100644 (file)
--- a/udev.c
+++ b/udev.c
@@ -179,27 +179,25 @@ int main(int argc, char *argv[], char *envp[])
                /* export name of device node or netif */
                if (udev.devname[0] != '\0')
                        setenv("DEVNAME", udev.devname, 1);
-       } else if (udev.type == DEV_DEVICE) {
-               if (strcmp(action, "add") == 0) {
-                       struct sysfs_device *devices_dev;
-
-                       /* wait for sysfs of /sys/devices/ */
-                       dbg("devices add");
-                       snprintf(path, sizeof(path), "%s%s", sysfs_path, devpath);
-                       path[sizeof(path)-1] = '\0';
-                       devices_dev = wait_devices_device_open(path);
-                       if (!devices_dev) {
-                               dbg("devices device unavailable (probably remove has beaten us)");
-                               goto run;
-                       }
-                       dbg("devices device opened '%s'", path);
-                       wait_for_devices_device(devices_dev, &error);
-                       udev_rules_get_run(&udev, devices_dev);
-                       sysfs_close_device(devices_dev);
-                       if (udev.ignore_device) {
-                               info("device event will be ignored");
-                               goto cleanup;
-                       }
+       } else if (udev.type == DEV_DEVICE && strcmp(action, "add") == 0) {
+               struct sysfs_device *devices_dev;
+
+               /* wait for sysfs of /sys/devices/ */
+               dbg("devices add");
+               snprintf(path, sizeof(path), "%s%s", sysfs_path, devpath);
+               path[sizeof(path)-1] = '\0';
+               devices_dev = wait_devices_device_open(path);
+               if (!devices_dev) {
+                       dbg("devices device unavailable (probably remove has beaten us)");
+                       goto run;
+               }
+               dbg("devices device opened '%s'", path);
+               wait_for_devices_device(devices_dev, &error);
+               udev_rules_get_run(&udev, devices_dev);
+               sysfs_close_device(devices_dev);
+               if (udev.ignore_device) {
+                       info("device event will be ignored");
+                       goto cleanup;
                }
        } else {
                dbg("default handling");
index 5c43190..90ce48c 100644 (file)
@@ -297,38 +297,38 @@ int wait_for_devices_device(struct sysfs_device *devices_dev,
                { .bus = "usb",         .file = "idVendor" },
                { .bus = "usb",         .file = "iInterface" },
                { .bus = "usb",         .file = "bNumEndpoints" },
-               { .bus = "usb-serial",  .file = "power" },
-               { .bus = "ide",         .file = "power" },
+               { .bus = "usb-serial",  .file = "bus" },
+               { .bus = "ide",         .file = "bus" },
                { .bus = "pci",         .file = "vendor" },
-               { .bus = "platform",    .file = "power" },
-               { .bus = "pcmcia",      .file = "power" },
-               { .bus = "i2c",         .file = "power" },
+               { .bus = "platform",    .file = "bus" },
+               { .bus = "pcmcia",      .file = "bus" },
+               { .bus = "i2c",         .file = "bus" },
                { .bus = "ieee1394",    .file = "node_count" },
                { .bus = "ieee1394",    .file = "nodeid" },
                { .bus = "ieee1394",    .file = "address" },
                { .bus = "bttv-sub",    .file = NULL },
-               { .bus = "pnp",         .file = "power" },
-               { .bus = "eisa",        .file = "power" },
-               { .bus = "serio",       .file = "power" },
-               { .bus = "pseudo",      .file = "power" },
-               { .bus = "mmc",         .file = "power" },
-               { .bus = "macio",       .file = "power" },
-               { .bus = "of_platform", .file = "power" },
-               { .bus = "vio",         .file = "power" },
-               { .bus = "ecard",       .file = "power" },
-               { .bus = "sa1111-rab",  .file = "power" },
-               { .bus = "amba",        .file = "power" },
-               { .bus = "locomo-bus",  .file = "power" },
-               { .bus = "logicmodule", .file = "power" },
-               { .bus = "parisc",      .file = "power" },
-               { .bus = "ocp",         .file = "power" },
-               { .bus = "dio",         .file = "power" },
-               { .bus = "MCA",         .file = "power" },
-               { .bus = "wl",          .file = "power" },
-               { .bus = "ccwgroup",    .file = "power" },
-               { .bus = "css",         .file = "power" },
-               { .bus = "ccw",         .file = "power" },
-               { .bus = "iucv",        .file = "power" },
+               { .bus = "pnp",         .file = "bus" },
+               { .bus = "eisa",        .file = "bus" },
+               { .bus = "serio",       .file = "bus" },
+               { .bus = "pseudo",      .file = "bus" },
+               { .bus = "mmc",         .file = "bus" },
+               { .bus = "macio",       .file = "bus" },
+               { .bus = "of_platform", .file = "bus" },
+               { .bus = "vio",         .file = "bus" },
+               { .bus = "ecard",       .file = "bus" },
+               { .bus = "sa1111-rab",  .file = "bus" },
+               { .bus = "amba",        .file = "bus" },
+               { .bus = "locomo-bus",  .file = "bus" },
+               { .bus = "logicmodule", .file = "bus" },
+               { .bus = "parisc",      .file = "bus" },
+               { .bus = "ocp",         .file = "bus" },
+               { .bus = "dio",         .file = "bus" },
+               { .bus = "MCA",         .file = "bus" },
+               { .bus = "wl",          .file = "bus" },
+               { .bus = "ccwgroup",    .file = "bus" },
+               { .bus = "css",         .file = "bus" },
+               { .bus = "ccw",         .file = "bus" },
+               { .bus = "iucv",        .file = "bus" },
                { NULL, NULL }
        };
        const struct device_file *devicefile = NULL;
index 77c0e6a..8078f62 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "libsysfs/sysfs/libsysfs.h"
 
-#define WAIT_MAX_SECONDS               5
+#define WAIT_MAX_SECONDS               3
 #define WAIT_LOOP_PER_SECOND           20
 
 extern dev_t get_devt(struct sysfs_class_device *class_dev);