regulators: Modify close() to use services

Modify the Device::close() method in the Device class to have a new
first parameter: Services& services.

Modify Device::close() to log messages using the new Journal
interface.

Modify the Chassis::closeDevices() method in the Chassis class to
have a new first parameter: Services& services.

Modify Chassis::closeDevices() to log messages using the new
Journal interface.

Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I2a07417d6f7470685f2c27c878ef7936e9f1aa8a
diff --git a/phosphor-regulators/src/device.cpp b/phosphor-regulators/src/device.cpp
index df73d1a..062ff27 100644
--- a/phosphor-regulators/src/device.cpp
+++ b/phosphor-regulators/src/device.cpp
@@ -18,7 +18,6 @@
 
 #include "chassis.hpp"
 #include "exception_utils.hpp"
-#include "journal.hpp"
 #include "system.hpp"
 
 #include <exception>
@@ -38,7 +37,7 @@
     }
 }
 
-void Device::close()
+void Device::close(Services& services)
 {
     try
     {
@@ -51,8 +50,8 @@
     catch (const std::exception& e)
     {
         // Log error messages in journal
-        exception_utils::log(e);
-        journal::logErr("Unable to close device " + id);
+        services.getJournal().logError(exception_utils::getMessages(e));
+        services.getJournal().logError("Unable to close device " + id);
 
         // TODO: Create error log entry
     }