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"
static int match_id(struct config_device *dev, struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
{
char path[SYSFS_PATH_MAX];
static int match_id(struct config_device *dev, struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
{
char path[SYSFS_PATH_MAX];
char *temp = NULL;
/* we have to have a sysfs device for ID to work */
if (!sysfs_device)
return -ENODEV;
char *temp = NULL;
/* we have to have a sysfs device for ID to work */
if (!sysfs_device)
return -ENODEV;
strfieldcpy(path, sysfs_device->path);
temp = strrchr(path, '/');
dbg("search '%s' in '%s', path='%s'", dev->id, temp, path);
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)
}
static int match_place(struct config_device *dev, struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
}
static int match_place(struct config_device *dev, struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)