sensors-detect: Detect graphics card in all cases

On recent kernels, the i2c bus may not be an immediate child of the
graphics device, instead there can be a drm class device in between.
Treat all drm class devices as graphics devices so that probing the
i2c bus is disabled by default as intended.
This commit is contained in:
Jean Delvare committed 2015-05-31 11:53:30 +00:00
1 parent 15cafdf597
commit 332c6fe2b9
2 files changed
+4 -1

No files matched your search

+1
View File
@@ -37,6 +37,7 @@ SVN HEAD
Document driver support for NCT7802Y
Add detection of NCT7904D
Add detection of IT8790E
Fix graphics cards detection (#2386, #2392)
3.3.5 "Happy Birthday Beddy" (2014-01-22)
libsensors: Improve documentation of two functions
+3 -1
View File
@@ -3897,7 +3897,9 @@ sub get_pci_class
my ($subsystem, $class);
$subsystem = sysfs_device_subsystem($device);
return 0 unless defined $subsystem && $subsystem eq "pci";
return 0 unless defined $subsystem;
return 0x0300 if $subsystem eq "drm"; # Graphics card
return 0 unless $subsystem eq "pci";
$class = sysfs_device_attribute($device, "class");
return 0 unless defined $class;