ret = ops->set_over_current_protection(rdev);
if (ret < 0) {
rdev_err(rdev, "failed to set over current protection\n");
----- goto out;
+++++ return ret;
+ +++ }
+ +++ }
+ +++
+ +++ if (rdev->constraints->active_discharge && ops->set_active_discharge) {
+ +++ bool ad_state = (rdev->constraints->active_discharge ==
+ +++ REGULATOR_ACTIVE_DISCHARGE_ENABLE) ? true : false;
+ +++
+ +++ ret = ops->set_active_discharge(rdev, ad_state);
+ +++ if (ret < 0) {
+ +++ rdev_err(rdev, "failed to set active discharge\n");
+ +++ return ret;
+ +++ }
+ +++ }
+ +++
++ +++ if (rdev->constraints->active_discharge && ops->set_active_discharge) {
++ +++ bool ad_state = (rdev->constraints->active_discharge ==
++ +++ REGULATOR_ACTIVE_DISCHARGE_ENABLE) ? true : false;
++ +++
++ +++ ret = ops->set_active_discharge(rdev, ad_state);
++ +++ if (ret < 0) {
++ +++ rdev_err(rdev, "failed to set active discharge\n");
++ +++ return ret;
+ }
+ }
+
print_constraints(rdev);
return 0;
-----out:
----- kfree(rdev->constraints);
----- rdev->constraints = NULL;
----- return ret;
}
/**