[SCSI] qla2xxx: Return blank sysfs string on initial get thermal failure.
authorJoe Carnuccio <joe.carnuccio@qlogic.com>
Thu, 9 Feb 2012 19:15:40 +0000 (11:15 -0800)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 19 Feb 2012 14:17:17 +0000 (08:17 -0600)
When thermal temperature initially fails, return a blank string to the
sysfs interface.  This fixes the initial display of 0.00 followed by
subsequent display of blank line; the initial 0.00 should have not
displayed for cards that do not support thermal temperature.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla2xxx/qla_attr.c

index 0635be522cd2174e15e1c5fddc6cc3df97ef4ead..5433f95f3eddd223f56f623c106c5ecc7f3ac53a 100644 (file)
@@ -1365,7 +1365,7 @@ qla2x00_thermal_temp_show(struct device *dev,
        else if (!vha->hw->flags.eeh_busy)
                rval = qla2x00_get_thermal_temp(vha, &temp, &frac);
        if (rval != QLA_SUCCESS)
-               temp = frac = 0;
+               return snprintf(buf, PAGE_SIZE, "\n");
 
        return snprintf(buf, PAGE_SIZE, "%d.%02d\n", temp, frac);
 }