diff options
author | patmans@us.ibm.com <patmans@us.ibm.com> | 2004-02-12 01:24:54 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:32:26 -0700 |
commit | 5a42932b9a783670ae3406fb2c3462036bb16d32 (patch) | |
tree | 5156ae2b54a039946878e076a9cbb3b57cfc4b3d | |
parent | 7b1cbec91a51a8d8f1546935d942744b0f5a274e (diff) |
[PATCH] udev kill extra bus_id compares in match_id
Kill the extra bus_id check in match_id. This is wrong, especially since
we check for rule matches with the parent devices on a given devices path.
For example, given a device path of:
/sys/devices/pci0000:01/0000:01:0c.0/host5/5:0:2:0
With this patch, the following rule will no longer match:
BUS="scsi", ID="host5", NAME="sd-bus_id-host5"
-rw-r--r-- | namedev.c | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -469,32 +469,19 @@ static int match_sysfs_pairs(struct config_device *dev, struct sysfs_class_devic static int match_id(struct config_device *dev, struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device) { char path[SYSFS_PATH_MAX]; - int found; char *temp = NULL; /* we have to have a sysfs device for ID to work */ if (!sysfs_device) return -ENODEV; - found = 0; strfieldcpy(path, sysfs_device->path); temp = strrchr(path, '/'); dbg("search '%s' in '%s', path='%s'", dev->id, temp, path); - if (strstr(temp, dev->id) != NULL) { - found = 1; - } else { - *temp = 0x00; - temp = strrchr(path, '/'); - dbg("search '%s' in '%s', path='%s'", dev->id, temp, path); - if (strstr(temp, dev->id) != NULL) - found = 1; - } - if (!found) { - dbg("id doesn't match"); + if (strstr(temp, dev->id) == NULL) return -ENODEV; - } - - return 0; + else + return 0; } static int match_place(struct config_device *dev, struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device) |