<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"><<a href="mailto:vignesh1192@gmail.com" target="_blank">vignesh1192@gmail.com</a>></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>'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<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>