diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 8e1be6a..e5d4dfb 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -485,29 +485,10 @@
 bool PSUManager::hasRequiredPSUs(
     std::map<std::string, std::string>& additionalData)
 {
-    // Check that all PSUs have the same model name. Initialize the model
-    // variable with the first PSU name found, then use it as a base to compare
-    // against the rest of the PSUs.
     std::string model{};
-    for (const auto& psu : psus)
+    if (!validateModelName(model, additionalData))
     {
-        auto psuModel = psu->getModelName();
-        if (psuModel.empty())
-        {
-            continue;
-        }
-        if (model.empty())
-        {
-            model = psuModel;
-            continue;
-        }
-        if (psuModel != model)
-        {
-            additionalData["EXPECTED_MODEL"] = model;
-            additionalData["ACTUAL_MODEL"] = psuModel;
-            additionalData["CALLOUT_INVENTORY_PATH"] = psu->getInventoryPath();
-            return false;
-        }
+        return false;
     }
 
     auto presentCount =
@@ -578,4 +559,35 @@
     return false;
 }
 
+bool PSUManager::validateModelName(
+    std::string& model, std::map<std::string, std::string>& additionalData)
+{
+    // Check that all PSUs have the same model name. Initialize the model
+    // variable with the first PSU name found, then use it as a base to compare
+    // against the rest of the PSUs.
+    model.clear();
+    for (const auto& psu : psus)
+    {
+        auto psuModel = psu->getModelName();
+        if (psuModel.empty())
+        {
+            continue;
+        }
+        if (model.empty())
+        {
+            model = psuModel;
+            continue;
+        }
+        if (psuModel != model)
+        {
+            additionalData["EXPECTED_MODEL"] = model;
+            additionalData["ACTUAL_MODEL"] = psuModel;
+            additionalData["CALLOUT_INVENTORY_PATH"] = psu->getInventoryPath();
+            model.clear();
+            return false;
+        }
+    }
+    return true;
+}
+
 } // namespace phosphor::power::manager
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index 085f11e..e54f536 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -263,6 +263,17 @@
     bool hasRequiredPSUs(std::map<std::string, std::string>& additionalData);
 
     /**
+     * @brief Helper function to validate that all PSUs have the same model name
+     *
+     * @param[out] model - The model name. Empty if there is a mismatch.
+     * @param[out] additionalData - If there is a mismatch, it contains debug
+     *             information such as the mismatched model name.
+     * @return true if all the PSUs have the same model name, false otherwise.
+     */
+    bool validateModelName(std::string& model,
+                           std::map<std::string, std::string>& additionalData);
+
+    /**
      * @brief Map of supported PSU configurations that include the model name
      * and their properties.
      */
