[PATCH v3] clk: implement clk_unregister
Russell King - ARM Linux
linux at arm.linux.org.uk
Mon Jun 3 05:46:02 EDT 2013
On Mon, Jun 03, 2013 at 05:37:06PM +0900, Jiada Wang wrote:
> Currently clk_unregister is unimplemented, it is required in case
> sub modules want actually remove clk device registered by clk_register.
> This patch adds the implementation of clk_unregister.
So what if someone has clk_get()'d this clock but not prepared it?
No, this is the wrong approach. If we want to do this then clocks
must be reference counted and freed when the refcount gets to zero,
just like struct device etc.
We have struct kref as the base structure in the kernel for dealing
with these problems, please look at using it.
More information about the linux-arm-kernel
mailing list