iwlwifi: mvm: return -ENODATA when reading the temperature with the FW down
authorLuca Coelho <luciano.coelho@intel.com>
Mon, 18 Sep 2017 11:39:26 +0000 (14:39 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 6 Oct 2017 10:59:44 +0000 (13:59 +0300)
It seems that libsensors treats -EIO as a special non-recoverable
failure when it tries to read the temperature while the firmware is
not running.  To solve that, change the error code to a milder
-ENODATA.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196941

Fixes: c221daf219b1 ("iwlwifi: mvm: add registration to thermal zone")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tt.c

index 4d907f60bce9f22ba0acf6169023aacd79f9bb75..1232f63278eb64167263e55255cb95b54c27258d 100644 (file)
@@ -631,7 +631,7 @@ static int iwl_mvm_tzone_get_temp(struct thermal_zone_device *device,
 
        if (!iwl_mvm_firmware_running(mvm) ||
            mvm->fwrt.cur_fw_img != IWL_UCODE_REGULAR) {
-               ret = -EIO;
+               ret = -ENODATA;
                goto out;
        }