regulators: Add clearErrorHistory to Device class

Add a clearErrorHistory() method to the Device 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: I6683b0c7b9abd61748ccb3512dda9111daed4929
diff --git a/phosphor-regulators/src/device.cpp b/phosphor-regulators/src/device.cpp
index 08c5174..da2f5ee 100644
--- a/phosphor-regulators/src/device.cpp
+++ b/phosphor-regulators/src/device.cpp
@@ -48,6 +48,15 @@
     }
 }
 
+void Device::clearErrorHistory()
+{
+    // Clear error history in each rail
+    for (std::unique_ptr<Rail>& rail : rails)
+    {
+        rail->clearErrorHistory();
+    }
+}
+
 void Device::close(Services& services)
 {
     try