<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>'make CONFIG_DEBUG_SECTION_MISMATCH=y'<br>
To build the kernel despite the mismatches, build with:<br>'make CONFIG_NO_ERROR_ON_MISMATCH=y'<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<linux/spinlock.h><br>#include <linux/module.h> /* Needed by all modules */<br>#include <linux/kernel.h><br>#include <asm/io.h> /* Needed for KERN_INFO */<br>#include <linux/platform_device.h><br>
MODULE_LICENSE ("GPL");<br><br><br>static int __devinit my_module_probe(struct platform_device *pdev){<br> <br> <br> printk(KERN_INFO "Probe\n");<br><br> return 0;<br><br>}<br>static int __devexit my_module_remove (struct platform_device *pdev)<br>
{<br> <br> printk(KERN_INFO "Goodbye world 1.\n");<br> return 0;<br><br>}<br>static struct of_device_id spinlock_match[] = {<br> {.compatible = "spinlockcrash"},<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 = "spinlock_platformdev",<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 "INIT");<br> <br>
platform_driver_register(&spinlock_platformdev);<br> return 0;<br>}<br>static void __exit mymodule_exit(void)<br>{<br> printk(KERN_INFO "GOOD BYE");<br> platform_driver_unregister(&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>