diff --git a/pmbus.cpp b/pmbus.cpp
index b525bd9..95e3bbb 100644
--- a/pmbus.cpp
+++ b/pmbus.cpp
@@ -53,7 +53,7 @@
     switch (type)
     {
         default:
-            /* fall through */
+        /* fall through */
         case Type::Base:
             return basePath;
             break;
@@ -111,7 +111,7 @@
         auto rc = errno;
 
         log<level::ERR>("Failed to read sysfs file",
-                entry("FILENAME=%s", path.c_str()));
+                        entry("FILENAME=%s", path.c_str()));
 
         elog<ReadFailure>(xyz::openbmc_project::Sensor::Device::
                           ReadFailure::CALLOUT_ERRNO(rc),
@@ -123,6 +123,38 @@
     return value != 0;
 }
 
+uint64_t PMBus::read(const std::string& name, Type type)
+{
+    uint64_t data = 0;
+    std::ifstream file;
+    auto path = getPath(type);
+    path /= name;
+
+    file.exceptions(std::ifstream::failbit |
+                    std::ifstream::badbit |
+                    std::ifstream::eofbit);
+
+    try
+    {
+        file.open(path);
+        file >> std::hex >> data;
+    }
+    catch (std::exception& e)
+    {
+        auto rc = errno;
+        log<level::ERR>("Failed to read sysfs file",
+                        entry("FILENAME=%s", path.c_str()));
+
+        using metadata = xyz::openbmc_project::Sensor::Device::ReadFailure;
+
+        elog<ReadFailure>(metadata::CALLOUT_ERRNO(rc),
+                          metadata::CALLOUT_DEVICE_PATH(
+                                  fs::canonical(basePath).c_str()));
+    }
+
+    return data;
+}
+
 void PMBus::write(const std::string& name, int value, Type type)
 {
     std::ofstream file;
@@ -144,7 +176,7 @@
         auto rc = errno;
 
         log<level::ERR>("Failed to write sysfs file",
-                entry("FILENAME=%s", path.c_str()));
+                        entry("FILENAME=%s", path.c_str()));
 
         elog<WriteFailure>(xyz::openbmc_project::Control::Device::
                            WriteFailure::CALLOUT_ERRNO(rc),
@@ -163,7 +195,7 @@
     for (auto& f : fs::directory_iterator(path))
     {
         if ((f.path().filename().string().find("hwmon") !=
-            std::string::npos) &&
+             std::string::npos) &&
             (fs::is_directory(f.path())))
         {
             hwmonDir = f.path().filename();
