[PATCH] udev add wild card compare for ID
Allow wild card comparison of the ID. Using strcmp_pattern here also means we on longer match partial values, for example, a scsi rule like this won't match anymore: BUS="scsi", ID=":0", NAME="sdfoo-short-bus_id-1" But this now works: BUS="scsi", ID="*:0", NAME="sdfoo-bus_id-wild-card-1"
This commit is contained in:
parent
5a42932b9a
commit
3a8c51a771
|
@ -477,8 +477,9 @@ static int match_id(struct config_device *dev, struct sysfs_class_device *class_
|
||||||
|
|
||||||
strfieldcpy(path, sysfs_device->path);
|
strfieldcpy(path, sysfs_device->path);
|
||||||
temp = strrchr(path, '/');
|
temp = strrchr(path, '/');
|
||||||
|
temp++;
|
||||||
dbg("search '%s' in '%s', path='%s'", dev->id, temp, path);
|
dbg("search '%s' in '%s', path='%s'", dev->id, temp, path);
|
||||||
if (strstr(temp, dev->id) == NULL)
|
if (strcmp_pattern(dev->id, temp) != 0)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue