Changeset 5404

Show
Ignore:
Timestamp:
11/23/08 16:16:45 (5 years ago)
Author:
khali
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/detect/sensors-detect

    r5403 r5404  
    24002400################# 
    24012401 
    2402 # From a sysfs device path, return the driver name, or undef 
     2402# From a sysfs device path, return the driver (module) name, or undef 
    24032403sub sysfs_device_driver($) 
    24042404{ 
    24052405  my $device = shift; 
    24062406 
    2407   my $link = readlink("$device/driver"); 
     2407  my $link = readlink("$device/driver/module"); 
    24082408  return unless defined $link; 
    24092409  return basename($link); 
     
    30753075    if (!i2c_set_slave_addr(\*FILE, $addr)) { 
    30763076      # If the address is busy, we can normally find out which driver 
    3077       # is using it, and we assume it is the right one. 
     3077      # requested it (if the kernel is recent enough, at least 2.6.16 
     3078      # and later are known to work), and we assume it is the right one. 
    30783079      my ($device, $driver); 
    30793080