drm/panfrost: Remove NULL checks for regulator
devm_regulator_get() is now used to populate pfdev->regulator which ensures that this cannot be NULL (a dummy regulator will be returned if necessary). So remove the checks in panfrost_devfreq_target(). Signed-off-by: Steven Price <steven.price@arm.com> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/3e3a2c8a-b4fc-8af6-39e1-b26160db2c7c@arm.com
This commit is contained in:
committed by
Rob Herring
parent
edfa07504c
commit
d18a966204
@@ -39,7 +39,7 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
|
|||||||
* If frequency scaling from low to high, adjust voltage first.
|
* If frequency scaling from low to high, adjust voltage first.
|
||||||
* If frequency scaling from high to low, adjust frequency first.
|
* If frequency scaling from high to low, adjust frequency first.
|
||||||
*/
|
*/
|
||||||
if (old_clk_rate < target_rate && pfdev->regulator) {
|
if (old_clk_rate < target_rate) {
|
||||||
err = regulator_set_voltage(pfdev->regulator, target_volt,
|
err = regulator_set_voltage(pfdev->regulator, target_volt,
|
||||||
target_volt);
|
target_volt);
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -53,14 +53,12 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
|
|||||||
if (err) {
|
if (err) {
|
||||||
dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate,
|
dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate,
|
||||||
err);
|
err);
|
||||||
if (pfdev->regulator)
|
regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt,
|
||||||
regulator_set_voltage(pfdev->regulator,
|
pfdev->devfreq.cur_volt);
|
||||||
pfdev->devfreq.cur_volt,
|
|
||||||
pfdev->devfreq.cur_volt);
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_clk_rate > target_rate && pfdev->regulator) {
|
if (old_clk_rate > target_rate) {
|
||||||
err = regulator_set_voltage(pfdev->regulator, target_volt,
|
err = regulator_set_voltage(pfdev->regulator, target_volt,
|
||||||
target_volt);
|
target_volt);
|
||||||
if (err)
|
if (err)
|
||||||
|
Reference in New Issue
Block a user