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:
Aleksander Morgado
2016-09-18 14:08:20 +02:00
parent 546d33db6c
commit aa0e108107
11 changed files with 40 additions and 42 deletions

View File

@@ -1,9 +1,10 @@
# do not edit this file, it will be overwritten on update
ACTION!="add|change|move", GOTO="mm_cinterion_port_types_end"
SUBSYSTEMS!="usb", GOTO="mm_cinterion_port_types_end"
SUBSYSTEM!="tty", GOTO="mm_cinterion_port_types_end"
ATTRS{idVendor}!="1e2d", GOTO="mm_cinterion_port_types_end"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e2d", GOTO="mm_cinterion_port_types"
GOTO="mm_cinterion_port_types_end"
LABEL="mm_cinterion_port_types"
ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ATTRS{bInterfaceNumber}=="01", ENV{ID_MM_CINTERION_PORT_TYPE_GPS}="1"