summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/platformsupport/udev/qudevicehelper.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/platformsupport/udev/qudevicehelper.cpp b/src/platformsupport/udev/qudevicehelper.cpp
index 688cedd304..0cf370badc 100644
--- a/src/platformsupport/udev/qudevicehelper.cpp
+++ b/src/platformsupport/udev/qudevicehelper.cpp
@@ -192,13 +192,18 @@ void QUDeviceHelper::handleUDevNotification()
subsystem = "drm";
else goto cleanup;
- // does not increase the refcount
- dev = udev_device_get_parent_with_subsystem_devtype(dev, subsystem, 0);
- if (!dev)
- goto cleanup;
-
types = checkDeviceType(dev);
+ // if we cannot determine a type, walk up the device tree
+ if (types == UDev_Unknown) {
+ // does not increase the refcount
+ dev = udev_device_get_parent_with_subsystem_devtype(dev, subsystem, 0);
+ if (!dev)
+ goto cleanup;
+
+ types = checkDeviceType(dev);
+ }
+
if (types && (qstrcmp(action, "add") == 0))
emit deviceDetected(devNode, types);