Re: [PATCH 2/2] pwm: pxa: Add optional bus clock

Uwe Kleine-König
2026-04-14T08:51:53Z

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

Hello,

On Tue, Apr 14, 2026 at 06:04:53AM +0000, Yixun Lan wrote:
> On 10:38 Mon 13 Apr , Uwe Kleine-König wrote:
> > On Thu, Apr 09, 2026 at 12:45:12AM +0000, Yixun Lan wrote:
> > > + /* Get named func clk if bus clock is valid */
> > > + pc->clk = devm_clk_get(dev, pc->bus_clk ? "func" : NULL);
> >
> > I'm not sure, but I think passing "func" unconditionally to
> > devm_clk_get() would also work fine.
> Passing "func" unconditionally, will break old compatibles(not k3-pwm), as only
> one clocks property is provided, but no clock-names property

I thought that if there is a single clock without a name,
clk_get(dev, "somename") will return that one. But looking at the code,
that assumption is wrong. So keeping the conditional here is fine.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]