mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Manush Prajwal" <manushprajwal555@gmail.com>
To: ukleinek@kernel.org
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] pwm: tiehrpwm: fix copy-paste error in obsolete DT binding fallback
Date: 28 Sep 2026 23:25:09 +0530	[thread overview]
Message-ID: <6abaa9fd.8a95a640.187520.71d6@mx.google.com> (raw)

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@gmail.com>
---
 drivers/pwm/pwm-tiehrpwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 3a53489f0..40166c5c8 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -426,7 +426,7 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
 
 	clk = devm_clk_get(&pdev->dev, "fck");
 	if (IS_ERR(clk)) {
-		if (of_device_is_compatible(np, "ti,am33xx-ecap")) {
+		if (of_device_is_compatible(np, "ti,am33xx-ehrpwm")) {
 			dev_warn(&pdev->dev, "Binding is obsolete.\n");
 			clk = devm_clk_get(pdev->dev.parent, "fck");
 		}
-- 
2.46.2.windows.1



             reply	other threads:[~2026-09-28 17:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 17:55 Manush Prajwal [this message]
2026-09-29  6:00 ` Uwe Kleine-König
2026-09-29 10:06 Manush Prajwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6abaa9fd.8a95a640.187520.71d6@mx.google.com \
    --to=manushprajwal555@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=ukleinek@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®