Re: [PATCH v12 04/15] drm/panfrost: Skip NULL checks for clock enable/disabling
From: Steven Price
Date: Fri Oct 02 2026 - 10:15:48 EST
On 29/09/2026 04:44, Adrián Larumbe wrote:
> The clk_* API can deal with NULL clock objects, so we can do away with NULL
> checks in client code.
>
> Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx>
> Signed-off-by: Adrián Larumbe <adrian.larumbe@xxxxxxxxxxxxx>
Reviewed-by: Steven Price <steven.price@xxxxxxx>
> ---
> 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);
> }
>
>