regulators: Add clearErrorHistory to System class

Add a clearErrorHistory() method to the System class.  The method should
clear all data on previously logged errors.  If the error occurs again
in the future, it will be logged again.

This method is normally called when the system is being powered on.  For
code that runs repeatedly, errors are only logged once per boot.

When the system is powered off, hardware may be replaced that fixes the
problem.  Thus, errors are cleared during power on.

Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
Change-Id: I6206cc22900c97f5fbfcd39fde81e448a89ac94d
diff --git a/phosphor-regulators/src/system.cpp b/phosphor-regulators/src/system.cpp
index 3cc2eb3..a36d1ee 100644
--- a/phosphor-regulators/src/system.cpp
+++ b/phosphor-regulators/src/system.cpp
@@ -43,6 +43,15 @@
     }
 }
 
+void System::clearErrorHistory()
+{
+    // Clear error history in each chassis
+    for (std::unique_ptr<Chassis>& oneChassis : chassis)
+    {
+        oneChassis->clearErrorHistory();
+    }
+}
+
 void System::closeDevices(Services& services)
 {
     // Close devices in each chassis