Thanks!<div><br></div><div>J.<br><br><div class="gmail_quote">On Sun, Feb 6, 2011 at 10:52 PM, Prabhu nath <span dir="ltr">&lt;<a href="mailto:gprabhunath@gmail.com">gprabhunath@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
__init is a qualifier to a function or initialized data and a hint to the linker to place all these <br>code and data in a seperate section in the object file, so that once these functions are executed, memory space occupied by these code and data will be freed. <br>

<br>It is the onus on the Kernel programmer to decide which functions/data to be marked as __init. <br>For Eg. the init functions of a driver module, in most cases will be executed only once and no other functions will invoke this init function. Thus, init function will be the right candidate to be marked as __init. <br>
<div class="im">
<br><a href="http://lxr.linux.no/#linux+v2.6.37/include/linux/init.h" target="_blank">http://lxr.linux.no/#linux+v2.6.37/include/linux/init.h</a><br><br></div>Regards,<br><font color="#888888">Prabhu<br><br><br></font><div class="gmail_quote">
<div><div></div><div class="h5">On Mon, Feb 7, 2011 at 12:11 PM, Joy Sun <span dir="ltr">&lt;<a href="mailto:joy2sun127@gmail.com" target="_blank">joy2sun127@gmail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div><div></div><div class="h5">Hi,<div><br></div><div>I am totally newbie for kernel device driver, and starting to learn.</div>

<div><br></div><div>When I see a driver code, I found __init. For example, static int __init xxxx(struct platform_device *pdev)</div>
<div><br></div><div>I understand &quot;static&quot; and &quot;int&quot;, but what is __init?</div><div><br></div><font color="#888888"><div>-J.</div>
</font><br></div></div><div class="im">_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br></div>