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

Uwe Kleine-König ukleinek at kernel.org
Tue Apr 14 01:51:50 PDT 2026


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20260414/fdb534db/attachment.sig>


More information about the linux-riscv mailing list