summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatmans@us.ibm.com <patmans@us.ibm.com>2004-02-12 01:24:54 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:26 -0700
commit5a42932b9a783670ae3406fb2c3462036bb16d32 (patch)
tree5156ae2b54a039946878e076a9cbb3b57cfc4b3d /namedev.c
parent[PATCH] better credential patch (diff)
downloadeudev-5a42932b9a783670ae3406fb2c3462036bb16d32.tar.gz
eudev-5a42932b9a783670ae3406fb2c3462036bb16d32.tar.bz2
eudev-5a42932b9a783670ae3406fb2c3462036bb16d32.zip
[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"
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/namedev.c b/namedev.c
index 3e2182ae7..59ec08c71 100644
--- a/namedev.c
+++ b/namedev.c
@@ -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)