mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 00:36:42 +07:00
Merge branch 'fix/core' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-core
This commit is contained in:
commit
ece497ae37
@ -1057,18 +1057,18 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
|
||||
ret = machine_constraints_voltage(rdev, rdev->constraints);
|
||||
if (ret != 0)
|
||||
goto out;
|
||||
return ret;
|
||||
|
||||
ret = machine_constraints_current(rdev, rdev->constraints);
|
||||
if (ret != 0)
|
||||
goto out;
|
||||
return ret;
|
||||
|
||||
if (rdev->constraints->ilim_uA && ops->set_input_current_limit) {
|
||||
ret = ops->set_input_current_limit(rdev,
|
||||
rdev->constraints->ilim_uA);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set input limit\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1077,21 +1077,20 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
ret = suspend_prepare(rdev, rdev->constraints->initial_state);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set suspend state\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (rdev->constraints->initial_mode) {
|
||||
if (!ops->set_mode) {
|
||||
rdev_err(rdev, "no set_mode operation\n");
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = ops->set_mode(rdev, rdev->constraints->initial_mode);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set initial mode: %d\n", ret);
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1102,7 +1101,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
ret = _regulator_do_enable(rdev);
|
||||
if (ret < 0 && ret != -EINVAL) {
|
||||
rdev_err(rdev, "failed to enable\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1111,7 +1110,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set ramp_delay\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1119,7 +1118,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
ret = ops->set_pull_down(rdev);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set pull down\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1127,7 +1126,7 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
ret = ops->set_soft_start(rdev);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set soft start\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1136,16 +1135,12 @@ static int set_machine_constraints(struct regulator_dev *rdev,
|
||||
ret = ops->set_over_current_protection(rdev);
|
||||
if (ret < 0) {
|
||||
rdev_err(rdev, "failed to set over current protection\n");
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
print_constraints(rdev);
|
||||
return 0;
|
||||
out:
|
||||
kfree(rdev->constraints);
|
||||
rdev->constraints = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3979,7 +3974,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
|
||||
|
||||
scrub:
|
||||
regulator_ena_gpio_free(rdev);
|
||||
kfree(rdev->constraints);
|
||||
|
||||
wash:
|
||||
device_unregister(&rdev->dev);
|
||||
/* device core frees rdev */
|
||||
|
Loading…
Reference in New Issue
Block a user