psu-ng: Make comm fault first checked

A communication failure would be a pretty serious fault condition. Check
for that fault first.

Change-Id: I51b24f50e569dab16609ccc235291df20be18729
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 24006aa..0a78a4d 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -406,7 +406,20 @@
                 // supply. Capture that data into the error as well.
                 additionalData["FW_VERSION"] = psu->getFWVersion();
 
-                if ((psu->hasInputFault() || psu->hasVINUVFault()))
+                if (psu->hasCommFault())
+                {
+                    /* Attempts to communicate with the power supply have
+                     * reached there limit. Create an error. */
+                    additionalData["CALLOUT_DEVICE_PATH"] =
+                        psu->getDevicePath();
+
+                    createError(
+                        "xyz.openbmc_project.Power.PowerSupply.Error.CommFault",
+                        additionalData);
+
+                    psu->setFaultLogged();
+                }
+                else if ((psu->hasInputFault() || psu->hasVINUVFault()))
                 {
                     // Include STATUS_INPUT for input faults.
                     additionalData["STATUS_INPUT"] =
@@ -445,19 +458,6 @@
 
                     psu->setFaultLogged();
                 }
-                else if (psu->hasCommFault())
-                {
-                    /* Attempts to communicate with the power supply have
-                     * reached there limit. Create an error. */
-                    additionalData["CALLOUT_DEVICE_PATH"] =
-                        psu->getDevicePath();
-
-                    createError(
-                        "xyz.openbmc_project.Power.PowerSupply.Error.CommFault",
-                        additionalData);
-
-                    psu->setFaultLogged();
-                }
             }
         }
     }