Re: [PATCH] pwm: tiehrpwm: fix copy-paste error in obsolete DT binding fallback

From: Uwe Kleine-König

Date: Tue Sep 29 2026 - 02:02:09 EST


Hello,

On Mon, Sep 28, 2026 at 11:25:09PM +0530, Manush Prajwal wrote:
> ehrpwm_pwm_probe() attempts to provide backward compatibility for older
> device trees where the functional clock "fck" was supplied by the parent
> PWMSS device rather than within the PWM child node itself.
>
> However, when devm_clk_get() for "fck" fails, the fallback checks:
>
> if (of_device_is_compatible(np, "ti,am33xx-ecap")) {
> dev_warn(&pdev->dev, "Binding is obsolete.\n");
> clk = devm_clk_get(pdev->dev.parent, "fck");
> }
>
> Because this logic was copied from pwm-tiecap.c, it mistakenly checks for
> "ti,am33xx-ecap" instead of "ti,am33xx-ehrpwm". An eHRPWM node matches
> ehrpwm_of_match ("ti,am3352-ehrpwm" or "ti,am33xx-ehrpwm") and will never
> be compatible with "ti,am33xx-ecap". Consequently, for any device tree
> using the obsolete "ti,am33xx-ehrpwm" binding, the fallback never triggers
> and probe fails with "Failed to get fck".
>
> Fix the check to test for "ti,am33xx-ehrpwm" as intended.
>
> Signed-off-by: Manush Prajwal <manushprajwal555@xxxxxxxxx>

Looks right, I guess it needs:
Fixes: ae5200d22716 ("pwm: pwm-ti*: Get the clock from the PWMSS parent when using old bindings")
.

I wonder: Did you find this because you still use the old bindings, or
by code inspection somehow? If the latter, maybe it's time to drop the
handling instead?

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature