The clk_* API can deal with NULL clock objects, so we can do away with NULL
checks in client code.

Reviewed-by: Boris Brezillon <[email protected]>
Signed-off-by: Adrián Larumbe <[email protected]>
---
 drivers/gpu/drm/panfrost/panfrost_device.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c 
b/drivers/gpu/drm/panfrost/panfrost_device.c
index 5bf528f41278..b3a53504bd01 100644
--- a/drivers/gpu/drm/panfrost/panfrost_device.c
+++ b/drivers/gpu/drm/panfrost/panfrost_device.c
@@ -510,11 +510,9 @@ static int panfrost_device_resume(struct device *dev)
                if (ret)
                        goto err_clk;
 
-               if (pfdev->bus_clock) {
-                       ret = clk_enable(pfdev->bus_clock);
-                       if (ret)
-                               goto err_bus_clk;
-               }
+               ret = clk_enable(pfdev->bus_clock);
+               if (ret)
+                       goto err_bus_clk;
        }
 
        ret = pm_runtime_force_resume(dev);
@@ -524,7 +522,7 @@ static int panfrost_device_resume(struct device *dev)
        return 0;
 
 err_resume:
-       if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS) && pfdev->bus_clock)
+       if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS))
                clk_disable(pfdev->bus_clock);
 err_bus_clk:
        if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS))
@@ -545,9 +543,7 @@ static int panfrost_device_suspend(struct device *dev)
                return ret;
 
        if (pfdev->comp->pm_features & BIT(GPU_PM_CLK_DIS)) {
-               if (pfdev->bus_clock)
-                       clk_disable(pfdev->bus_clock);
-
+               clk_disable(pfdev->bus_clock);
                clk_disable(pfdev->clock);
        }
 

-- 
2.55.0

Reply via email to