<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">try removing __devinit and </span><span style="font-family:arial,sans-serif;font-size:13px">__devexit from probe and remove. This is not needed as it is module.</span><br>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 30, 2013 at 4:36 PM, Vignesh Radhakrishnan <span dir="ltr">&lt;<a href="mailto:vignesh1192@gmail.com" target="_blank">vignesh1192@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"><div dir="ltr"><div>Hi,<br><br>I am facing the following error when i am building the kernel.<br><br><br>ERROR: modpost: Found 2 section mismatch(es).<br>

To see full details build your kernel with:<br>&#39;make CONFIG_DEBUG_SECTION_MISMATCH=y&#39;<br>
To build the kernel despite the mismatches, build with:<br>&#39;make CONFIG_NO_ERROR_ON_MISMATCH=y&#39;<br>(NOTE: This is not recommended)<br>make[3]: *** [__modpost] Error 1<br>make[2]: *** [modules] Error 2<br>make[1]: *** [sub-make] Error 2<br>


<br></div><div>After i did make the kernel using make CONFIG_DEBUG_SECTION_MISMATCH=y it said <b>section mismatch .</b><br></div><div><br></div><div>I am trying to write a platform driver (not sure if my code is right )<br>


<br>#include&lt;linux/spinlock.h&gt;<br>#include &lt;linux/module.h&gt;       /* Needed by all modules */<br>#include &lt;linux/kernel.h&gt;<br>#include &lt;asm/io.h&gt;     /* Needed for KERN_INFO */<br>#include &lt;linux/platform_device.h&gt;<br>


MODULE_LICENSE (&quot;GPL&quot;);<br><br><br>static int __devinit my_module_probe(struct platform_device *pdev){<br>    <br>    <br>    printk(KERN_INFO &quot;Probe\n&quot;);<br><br>       return 0;<br><br>}<br>static int  __devexit my_module_remove (struct platform_device *pdev)<br>


{<br>    <br>        printk(KERN_INFO &quot;Goodbye world 1.\n&quot;);<br>    return 0;<br><br>}<br>static struct of_device_id spinlock_match[] = {<br>        {.compatible = &quot;spinlockcrash&quot;},<br>        {}<br>};<br>


<br><br>static struct platform_driver spinlock_platformdev = {<br>        .probe          = my_module_probe,<br>        .remove         = __devexit_p(my_module_remove),<br>        .driver         = {<br>                .name   = &quot;spinlock_platformdev&quot;,<br>


                .owner  = THIS_MODULE,<br>        .of_match_table = spinlock_match,<br>        },<br>};<br><br><br><br>static int __init mymodule_init(void)<br>{<br>        printk(KERN_INFO &quot;INIT&quot;);<br>        <br>


            platform_driver_register(&amp;spinlock_platformdev);<br>        return 0;<br>}<br>static void __exit mymodule_exit(void)<br>{<br>    printk(KERN_INFO &quot;GOOD BYE&quot;);<br>        platform_driver_unregister(&amp;spinlock_platformdev);<br>


}<br>  <br>module_init(mymodule_init);<br>module_exit(mymodule_exit);<br><br><br><br></div><div>Can anybody throw some light on what might be happening here ?<br><br></div><div><div><br></div><div>Thanks and regards,<br>

</div>
<div>Vignesh<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div>-- <br><a href="http://vigneshradhakrishnan.blogspot.com/" target="_blank">http://vigneshradhakrishnan.blogspot.com/</a><br>


</div></font></span></div></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">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></blockquote></div><br></div>