]> Git Repo - J-linux.git/commitdiff
drm/panfrost: Remove NULL checks for regulator
authorSteven Price <[email protected]>
Fri, 6 Sep 2019 14:20:53 +0000 (15:20 +0100)
committerRob Herring <[email protected]>
Thu, 19 Sep 2019 16:45:44 +0000 (11:45 -0500)
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]
drivers/gpu/drm/panfrost/panfrost_devfreq.c

index a1f5fa6a742ab9e311aa638485adae78d0a44d74..12ff77dacc9541fb3d7a1af3d9d3f0876f59d8b8 100644 (file)
@@ -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 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,
                                            target_volt);
                if (err) {
@@ -53,14 +53,12 @@ static int panfrost_devfreq_target(struct device *dev, unsigned long *freq,
        if (err) {
                dev_err(dev, "Cannot set frequency %lu (%d)\n", target_rate,
                        err);
-               if (pfdev->regulator)
-                       regulator_set_voltage(pfdev->regulator,
-                                             pfdev->devfreq.cur_volt,
-                                             pfdev->devfreq.cur_volt);
+               regulator_set_voltage(pfdev->regulator, pfdev->devfreq.cur_volt,
+                                     pfdev->devfreq.cur_volt);
                return err;
        }
 
-       if (old_clk_rate > target_rate && pfdev->regulator) {
+       if (old_clk_rate > target_rate) {
                err = regulator_set_voltage(pfdev->regulator, target_volt,
                                            target_volt);
                if (err)
This page took 0.0519 seconds and 4 git commands to generate.