diff options
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 370c655ad8f6..03154f5b939f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4321,6 +4321,7 @@ EXPORT_SYMBOL_GPL(regulator_set_load); int regulator_allow_bypass(struct regulator *regulator, bool enable) { struct regulator_dev *rdev = regulator->rdev; + const char *name = rdev_get_name(rdev); int ret = 0; if (!rdev->desc->ops->set_bypass) @@ -4335,18 +4336,26 @@ int regulator_allow_bypass(struct regulator *regulator, bool enable) rdev->bypass_count++; if (rdev->bypass_count == rdev->open_count) { + trace_regulator_bypass_enable(name); + ret = rdev->desc->ops->set_bypass(rdev, enable); if (ret != 0) rdev->bypass_count--; + else + trace_regulator_bypass_enable_complete(name); } } else if (!enable && regulator->bypass) { rdev->bypass_count--; if (rdev->bypass_count != rdev->open_count) { + trace_regulator_bypass_disable(name); + ret = rdev->desc->ops->set_bypass(rdev, enable); if (ret != 0) rdev->bypass_count++; + else + trace_regulator_bypass_disable_complete(name); } } |