diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-06-22 02:11:59 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-06-22 02:11:59 +0200 |
commit | c9b8dbfb652a10d2f1c1b122a3806c21cab87ab4 (patch) | |
tree | b5becd9919e10fc73f5b7bc3701ae54bf689aeb2 | |
parent | 972d318a3123b00d0ed6b78bbcf70a0965841a8e (diff) |
fix the fix and change the file to wait for to the "bus" link
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
-rw-r--r-- | udev.c | 40 | ||||
-rw-r--r-- | udev_sysfs.c | 54 | ||||
-rw-r--r-- | udev_sysfs.h | 2 |
3 files changed, 47 insertions, 49 deletions
@@ -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"); diff --git a/udev_sysfs.c b/udev_sysfs.c index 5c43190644..90ce48caea 100644 --- a/udev_sysfs.c +++ b/udev_sysfs.c @@ -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; diff --git a/udev_sysfs.h b/udev_sysfs.h index 77c0e6a8ef..8078f62d82 100644 --- a/udev_sysfs.h +++ b/udev_sysfs.h @@ -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); |