udev: fix SUBSYSTEMS and ATTRS{idVendor} checks
Rules with a single condition where a parent property is checked with != don't
work properly. E.g.:
SUBSYSTEMS!="usb", GOTO="end"
or:
ATTRS{idVendor}!="abcd", GOTO="end"
Instead, we can mix both those previous parent rules and match them:
SUBSYSTEMS=="usb",ATTRS{idVendor}=="abcd", GOTO="next"
GOTO="end"
LABEL="next"
# Apply rules here
LABEL="end"
In this case both SUBSYSTEMS and ATTRS conditions apply to the parent usb_device
(idVendor attribute is only available in the usb_device), so they apply to all
ports of the same device.
This commit is contained in:
@@ -11,9 +11,10 @@
|
||||
|
||||
|
||||
ACTION!="add|change|move", GOTO="mm_simtech_port_types_end"
|
||||
SUBSYSTEMS!="usb", GOTO="mm_simtech_port_types_end"
|
||||
SUBSYSTEM!="tty", GOTO="mm_simtech_port_types_end"
|
||||
ATTRS{idVendor}!="1e0e", GOTO="mm_simtech_port_types_end"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e0e", GOTO="mm_simtech_port_types"
|
||||
GOTO="mm_simtech_port_types_end"
|
||||
|
||||
LABEL="mm_simtech_port_types"
|
||||
|
||||
# A-LINK 3GU
|
||||
ATTRS{idVendor}=="1e0e", ATTRS{idProduct}=="cefe", ATTRS{bInterfaceNumber}=="02", ENV{ID_MM_SIMTECH_PORT_TYPE_MODEM}="1"
|
||||
|
||||
Reference in New Issue
Block a user