<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<br></div><div>-- <br><a href="http://vigneshradhakrishnan.blogspot.com/" target="_blank">http://vigneshradhakrishnan.blogspot.com/</a><br>
</div></div></div>