• Edwin Peer's avatar
    bnxt_en: return proper error codes in bnxt_show_temp · d69753fa
    Edwin Peer authored
    Returning "unknown" as a temperature value violates the hwmon interface
    rules. Appropriate error codes should be returned via device_attribute
    show instead. These will ultimately be propagated to the user via the
    file system interface.
    
    In addition to the corrected error handling, it is an even better idea to
    not present the sensor in sysfs at all if it is known that the read will
    definitely fail. Given that temp1_input is currently the only sensor
    reported, ensure no hwmon registration if TEMP_MONITOR_QUERY is not
    supported or if it will fail due to access permissions. Something smarter
    may be needed if and when other sensors are added.
    
    Fixes: 12cce90b ("bnxt_en: fix HWRM error when querying VF temperature")
    Signed-off-by: default avatarEdwin Peer <edwin.peer@broadcom.com>
    Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    d69753fa
bnxt.c 332 KB