From: Biju Das Date: Fri, 20 Mar 2026 16:41:48 +0000 (+0000) Subject: drm/panfrost: Drop redundant optional clock checks in runtime PM X-Git-Tag: v7.2-rc1~141^2~26^2~197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a14d961660eaa17f21918d0cdf75a00b613ee05;p=thirdparty%2Fkernel%2Flinux.git drm/panfrost: Drop redundant optional clock checks in runtime PM The clk_enable() and clk_disable() APIs already handle NULL clock pointers gracefully — clk_enable() returns 0 and clk_disable() returns immediately when passed a NULL or optional clock. The explicit if (pfdev->bus_clock) guards around these calls in the runtime suspend/resume paths are therefore unnecessary. Remove them to simplify the code. Reviewed-by: Steven Price Signed-off-by: Biju Das Reviewed-by: Adrián Larumbe Link: https://patch.msgid.link/20260320164158.487406-3-biju.das.jz@bp.renesas.com Signed-off-by: Adrián Larumbe --- diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index dedc13e56631e..01e702a0b2f07 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -429,11 +429,9 @@ static int panfrost_device_runtime_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; } panfrost_device_reset(pfdev, true); @@ -464,9 +462,7 @@ static int panfrost_device_runtime_suspend(struct device *dev) panfrost_gpu_power_off(pfdev); if (pfdev->comp->pm_features & BIT(GPU_PM_RT)) { - if (pfdev->bus_clock) - clk_disable(pfdev->bus_clock); - + clk_disable(pfdev->bus_clock); clk_disable(pfdev->clock); reset_control_assert(pfdev->rstc); }