What is __init?

Joy Sun joy2sun127 at gmail.com
Mon Feb 7 01:59:07 EST 2011


Thanks!

J.

On Sun, Feb 6, 2011 at 10:48 PM, Alexandre Courbot <gnurou at gmail.com> wrote:

> > When I see a driver code, I found __init. For example, static int __init
> > xxxx(struct platform_device *pdev)
> > I understand "static" and "int", but what is __init?
>
> __init places the symbol it qualifies into a special section of the
> kernel that is discarded from memory once all initialization functions
> are called. Since an initialization function is called only once
> during system startup, it does not make sense to keep it once the
> initialization phase is finished. __init allows to do that.
>
> See also http://www.faqs.org/docs/kernel/x277.html
>
> Alex.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110206/d4adf996/attachment.html 


More information about the Kernelnewbies mailing list