2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-31 06:15:15 +00:00

Fix device->driver lookup name. What we are really interested in is the

name of the kernel module, not the name of the driver. This went unnoticed
so far because almost all hwmon drivers have a driver name equal to the
module name.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5404 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-11-23 15:16:45 +00:00
parent 973789e9e6
commit 963ca0992c

View File

@@ -2399,12 +2399,12 @@ sub initialize_modules_supported
# SYSFS HELPERS #
#################
# From a sysfs device path, return the driver name, or undef
# From a sysfs device path, return the driver (module) name, or undef
sub sysfs_device_driver($)
{
my $device = shift;
my $link = readlink("$device/driver");
my $link = readlink("$device/driver/module");
return unless defined $link;
return basename($link);
}
@@ -3074,7 +3074,8 @@ sub scan_adapter
if (!i2c_set_slave_addr(\*FILE, $addr)) {
# If the address is busy, we can normally find out which driver
# is using it, and we assume it is the right one.
# requested it (if the kernel is recent enough, at least 2.6.16
# and later are known to work), and we assume it is the right one.
my ($device, $driver);
$device = sprintf("$sysfs_root/bus/i2c/devices/\%d-\%04x",