tdehwlib: Allow to classify virtual devices by subsystem

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 8 years ago
parent 2aa548763e
commit a73511a98d

@ -2090,9 +2090,6 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
if (devicesubsystem == "backlight") { if (devicesubsystem == "backlight") {
if (!device) device = new TDEBacklightDevice(TDEGenericDeviceType::Backlight); if (!device) device = new TDEBacklightDevice(TDEGenericDeviceType::Backlight);
} }
if (systempath.lower().startsWith("/sys/devices/virtual")) {
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::OtherVirtual);
}
if (systempath.lower().startsWith("/sys/module/") if (systempath.lower().startsWith("/sys/module/")
|| (systempath.lower().startsWith("/sys/kernel/"))) { || (systempath.lower().startsWith("/sys/kernel/"))) {
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Platform); // FIXME Should go into a new kernel module category when the tdelibs ABI can be broken again if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Platform); // FIXME Should go into a new kernel module category when the tdelibs ABI can be broken again
@ -2288,6 +2285,9 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
if (!device) device = new TDEBatteryDevice(TDEGenericDeviceType::Battery); if (!device) device = new TDEBatteryDevice(TDEGenericDeviceType::Battery);
} }
} }
if (systempath.lower().startsWith("/sys/devices/virtual")) {
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::OtherVirtual);
}
// Moderate accuracy classification, if PCI device class is available // Moderate accuracy classification, if PCI device class is available
// See http://www.acm.uiuc.edu/sigops/roll_your_own/7.c.1.html for codes and meanings // See http://www.acm.uiuc.edu/sigops/roll_your_own/7.c.1.html for codes and meanings

Loading…
Cancel
Save