Skip to content

Commit 7b91463

Browse files
ShadowApexpastaq
authored andcommitted
fix(IIO): don't check udev configs for iio devices
1 parent d50bd43 commit 7b91463

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/config/mod.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,22 @@ impl CompositeDeviceConfig {
422422
config: &SourceDevice,
423423
udevice: &UdevDevice,
424424
) -> Option<SourceDevice> {
425+
let subsystem = udevice.subsystem();
426+
427+
// TODO: This is a dirty hack to get around slow iio udev querying on
428+
// some devices. Replace with proper mitigation.
429+
let should_check_udev = { subsystem.as_str() != "iio" };
430+
425431
// Check udev matches first
426-
if let Some(udev_config) = config.udev.as_ref() {
427-
if self.has_matching_udev(udevice, udev_config) {
428-
return Some(config.clone());
432+
if should_check_udev {
433+
if let Some(udev_config) = config.udev.as_ref() {
434+
if self.has_matching_udev(udevice, udev_config) {
435+
return Some(config.clone());
436+
}
429437
}
430438
}
431439

432440
// Use subsystem-specific device matching
433-
let subsystem = udevice.subsystem();
434441
match subsystem.as_str() {
435442
"input" => {
436443
let evdev_config = config.evdev.as_ref()?;

0 commit comments

Comments
 (0)