Changeset 5120

Show
Ignore:
Timestamp:
02/08/08 20:10:35 (10 months ago)
Author:
khali
Message:

lm90: Use generic i2c reads during detection (2.6 backport).

Files:

Legend:

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

    r5119 r5120  
    1414  Module gl518sm: Fix fan speed reading (2.6 backport) 
    1515  Module gl520sm: Fix fan speed reading (2.6 backport) 
     16  Module lm90: Use generic i2c reads during detection (2.6 backport) 
    1617  Program decode-dimms.pl: Fix DDR2 SDRAM module speed decoding 
    1718                           Update manufacturer IDs. 
  • lm-sensors/trunk/kernel/chips/lm90.c

    r4608 r5120  
    396396 
    397397        if (kind < 0) { /* detection and identification */ 
    398                 u8 man_id, chip_id, reg_config1, reg_convrate; 
    399  
    400                 if (lm90_read_reg(new_client, LM90_REG_R_MAN_ID
    401                                   &man_id) < 0 
    402                  || lm90_read_reg(new_client, LM90_REG_R_CHIP_ID
    403                                  &chip_id) < 0 
    404                  || lm90_read_reg(new_client, LM90_REG_R_CONFIG1
    405                                  &reg_config1) < 0 
    406                  || lm90_read_reg(new_client, LM90_REG_R_CONVRATE
    407                                  &reg_convrate) < 0) 
     398                int man_id, chip_id, reg_config1, reg_convrate; 
     399 
     400                if ((man_id = i2c_smbus_read_byte_data(new_client
     401                                               LM90_REG_R_MAN_ID)) < 0 
     402                 || (chip_id = i2c_smbus_read_byte_data(new_client
     403                                               LM90_REG_R_CHIP_ID)) < 0 
     404                 || (reg_config1 = i2c_smbus_read_byte_data(new_client
     405                                               LM90_REG_R_CONFIG1)) < 0 
     406                 || (reg_convrate = i2c_smbus_read_byte_data(new_client
     407                                               LM90_REG_R_CONVRATE)) < 0) 
    408408                        goto exit_free; 
    409409 
    410410                if (man_id == 0x01) { /* National Semiconductor */ 
    411                         u8 reg_config2; 
    412  
    413                         if (lm90_read_reg(new_client, LM90_REG_R_CONFIG2
    414                                           &reg_config2) < 0) 
     411                        int reg_config2; 
     412 
     413                        if ((reg_config2 = i2c_smbus_read_byte_data(new_client
     414                                               LM90_REG_R_CONFIG2)) < 0) 
    415415                                goto exit_free; 
    416416