[PATCH v3] clk: implement clk_unregister
Jiada Wang
jiada_wang at mentor.com
Tue Jun 4 03:43:04 EDT 2013
Hello
Wang, Jiada (ESD) wrote:
>
> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
> Sent: Monday, June 03, 2013 6:46 PM
> To: Wang, Jiada (ESD)
> Cc: linux-arm-kernel at lists.infradead.org; u.kleine-koenig at pengutronix.de
> Subject: Re: [PATCH v3] clk: implement clk_unregister
>
> 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.
>
Russell
Thanks for your comment, I will look at kref.
Thanks,
jiada
More information about the linux-arm-kernel
mailing list