Changeset 4159

Show
Ignore:
Timestamp:
09/19/06 12:01:12 (2 years ago)
Author:
khali
Message:

libsensors: Missing sysfs busses and classes are not errors. This tends
to confuse users a lot, to report the lack of hwmon driver as an error.
prog/sensors: Clearer error messages when no sensors are found. The
most frequent cause is a lack of drivers, not procfs/sysfs problems.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r4154 r4159  
    1717           Add support for the W83793 chip (Yuan Mu) 
    1818           Map the 2.6 adm1026's fan8 to fan0 
     19           Missing sysfs busses and classes are not errors 
    1920  Makefile: Don't grep autoconf.h on user-space targets 
    2021            Fix depmod on non-running kernel version 
     
    6061                   The adt7463 may not have in4 (#2119) 
    6162                   Hide more vt1211 missing input errors 
     63                   Clearer error messages when no sensors found 
    6264  Program sensors-detect: Add ServerWorks HT-1000 SMBus detection 
    6365                          Add ATI IXP200/300/400 SMBus detection 
  • lm-sensors/trunk/lib/sysfs.c

    r4138 r4159  
    113113 
    114114        if (!(bus = sysfs_open_bus("i2c"))) { 
    115                 ret = -SENSORS_ERR_PROC; 
     115                if (errno && errno != ENOENT) 
     116                        ret = -SENSORS_ERR_PROC; 
    116117                goto exit0; 
    117118        } 
    118119 
    119120        if (!(devs = sysfs_get_bus_devices(bus))) { 
    120                 if (errno
     121                if (errno && errno != ENOENT
    121122                        ret = -SENSORS_ERR_PROC; 
    122123                goto exit1; 
     
    149150 
    150151        if (!(clsdevs = sysfs_get_class_devices(cls))) { 
    151                 if (errno
     152                if (errno && errno != ENOENT
    152153                        ret = -SENSORS_ERR_PROC; 
    153154                goto exit; 
     
    186187 
    187188        if (!(clsdevs = sysfs_get_class_devices(cls))) { 
    188                 if (errno
     189                if (errno && errno != ENOENT
    189190                        ret = -SENSORS_ERR_PROC; 
    190191                goto exit1; 
  • lm-sensors/trunk/prog/sensors/main.c

    r4109 r4159  
    239239    if (res == -SENSORS_ERR_PROC) 
    240240      fprintf(stderr, 
    241               "Unable to find i2c bus information;\n" 
     241              "Kernel interface access error\n" 
    242242              "For 2.6 kernels, make sure you have mounted sysfs and libsensors\n" 
    243               "was compiled with sysfs support!\n" 
    244               "For older kernels, make sure you have done 'modprobe i2c-proc'!\n"); 
     243              "was compiled with sysfs support!\n"); 
    245244    exit(1); 
    246245  } 
     
    257256  } else { 
    258257    if(chips[0].prefix == SENSORS_CHIP_NAME_PREFIX_ANY) 
    259             fprintf(stderr,"No sensors found!\n"); 
     258            fprintf(stderr, 
     259                    "No sensors found!\n" 
     260                    "Make sure you loaded all the kernel drivers you need.\n" 
     261                    "Try sensors-detect to find out which these are.\n"); 
    260262    else 
    261263            fprintf(stderr,"Specified sensor(s) not found!\n");