psu-ng: Move bindDelay into bindOrUnbindDriver()
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: Ia936958deb8b6c6c413d58339c54a8930e773090
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 4b43cb2..af0af69 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -94,6 +94,7 @@
if (present)
{
+ std::this_thread::sleep_for(std::chrono::milliseconds(bindDelay));
log<level::INFO>(
fmt::format("Binding device driver. path: {} device: {}",
path.string(), bindDevice)
@@ -182,7 +183,6 @@
if (present)
{
- std::this_thread::sleep_for(std::chrono::milliseconds(bindDelay));
bindOrUnbindDriver(present);
pmbusIntf->findHwmonDir();
onOffConfig(phosphor::pmbus::ON_OFF_CONFIG_CONTROL_PIN_ONLY);