Re: [PATCH] clk: sifive: Do not register clkdevs for PRCI clocks

From: Russell King (Oracle)
Date: Tue May 28 2024 - 04:04:58 EST


On Mon, May 27, 2024 at 05:14:12PM -0700, Samuel Holland wrote:
> These clkdevs were unnecessary, because systems using this driver always
> look up clocks using the devicetree. And as Russell King points out[1],
> since the provided device name was truncated, lookups via clkdev would
> never match.

There is another reason they would never match - clkdev has always been
about matching the clock _consumer_ using the device name and connection
name to the producer. The device and connection name passed into clkdev
should always be the consumer (it's documented as such.)

Providing the producer device name to clkdev when registering an entry
will mean that clk_get(consumer_dev, consumer_name) will fail to find
the entry in clkdev's table, and thus fail to find the clock.

So, this code has been incorrect from the very start.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!