Skip to content

Commit d18a966

Browse files
Steven Pricerobherring
authored andcommitted
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 <[email protected]> Signed-off-by: Rob Herring <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent edfa075 commit d18a966

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/gpu/drm/panfrost/panfrost_devfreq.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
3939
* If frequency scaling from low to high, adjust voltage first.
4040
* If frequency scaling from high to low, adjust frequency first.
4141
*/
42-
if (old_clk_rate < target_rate && pfdev->regulator) {
42+
if (old_clk_rate < target_rate) {
4343
err = regulator_set_voltage(pfdev->regulator, target_volt,
4444
target_volt);
4545
if (err) {
@@ -53,14 +53,12 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
5353
if (err) {
5454
dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate,
5555
err);
56-
if (pfdev->regulator)
57-
regulator_set_voltage(pfdev->regulator,
58-
pfdev->devfreq.cur_volt,
59-
pfdev->devfreq.cur_volt);
56+
regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt,
57+
pfdev->devfreq.cur_volt);
6058
return err;
6159
}
6260

63-
if (old_clk_rate > target_rate && pfdev->regulator) {
61+
if (old_clk_rate > target_rate) {
6462
err = regulator_set_voltage(pfdev->regulator, target_volt,
6563
target_volt);
6664
if (err)

0 commit comments

Comments
 (0)