Hi Yong,
> >> +static int __init clk_debugfs_init(void)
> >> +{
> >> + struct preinit_clk *pclk, *tmp;
> >> +
> >> + if (debugfs_initialized())
> >> + init_done = 1;
> >
> > No need to check debugfs_initialised() here; if it's not initialised
> > we're in trouble anyway.
>
> IMO, it is still needed. If debugfs is not initialised, we should
> return directly, otherwise, it will redo clk_debug_register() again.
>
> How about:
> if (!debugfs_initialized())
> return 0;
>
> init_done = 1;
>
debugfs is initialised as a core_initcall (and clk_debugfs_init as a
late_initcall), so we should never see this case.
However, if we ever do the 'return 0', there is no mechanism to retry the
initialisation (ie, clk_debugfs_register will only be called once), so we'll
just keep adding clocks to preinit_list.
If anything, return an error code (-EBUSY maybe?) so that we get a useful
message with initcall_debug. But I don't think this is necessary.
Cheers,
Jeremy
_______________________________________________
linaro-dev mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/linaro-dev