diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-01-29 17:08:44 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-01-29 17:08:44 +0100 |
commit | 9538b16d8b6086691dd01d76dea91ba73d13a630 (patch) | |
tree | c823009cc2a7bf56b863324aab8d1f462c07867c | |
parent | 34f55103c5d451d247fc3b57579a6b3c1de0d58d (diff) |
let SYSFS{} look at the device, not only the parent device
The stricter parent logic broke: BUS=="ide", SYSFS{removable}=="1", ...
cause removable is on the block device, which isn't a ide device.
Just look for matching attributes at the device and the selected parent
device at the same time now.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
-rw-r--r-- | udev_rules.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/udev_rules.c b/udev_rules.c index f1bbfd854c..8e9c1605bf 100644 --- a/udev_rules.c +++ b/udev_rules.c @@ -348,14 +348,14 @@ static int wait_for_sysfs(struct udevice *udev, const char *file, int timeout) snprintf(filename, sizeof(filename), "%s%s/%s", sysfs_path, udev->dev->devpath, file); filename[sizeof(filename)-1] = '\0'; - dbg("wait %i sec for '%s'", timeout, filename); + dbg("will wait %i sec for '%s'", timeout, filename); while (--loop) { if (stat(filename, &stats) == 0) { info("file '%s' appeared after %i loops", filename, (timeout * WAIT_LOOP_PER_SECOND) - loop-1); return 0; } - info("wait for %i mseconds", 1000 / WAIT_LOOP_PER_SECOND); + info("wait for '%s' for %i mseconds", filename, 1000 / WAIT_LOOP_PER_SECOND); usleep(1000 * 1000 / WAIT_LOOP_PER_SECOND); } err("waiting for '%s' failed", filename); @@ -782,6 +782,8 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule) value = sysfs_attr_get_value(udev->dev_parent->devpath, key_name); if (value == NULL) + value = sysfs_attr_get_value(udev->dev->devpath, key_name); + if (value == NULL) goto try_parent; strlcpy(val, value, sizeof(val)); |