Re: [PATCH 2/2] pwm: pxa: Add optional bus clock
From: Uwe Kleine-König
Date: Tue Apr 14 2026 - 04:55:09 EST
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:
signature.asc
Description: PGP signature