<div dir="ltr"><div><div><div><div>&gt; source code:<br>&gt;<br>&gt; MODULE_ALIAS(&quot;platform:sm501&quot;);<br>&gt;<br>&gt; static const struct of_device_id of_sm501_match_tbl[] = {<br>&gt;     { .compatible = &quot;smi,sm501&quot;, },<br>&gt;     { /* end */ }<br>&gt; };<br>&gt; MODULE_DEVICE_TABLE(of, of_sm501_match_tbl);<br>&gt;<br>&gt; location: <a href="http://lxr.free-electrons.com/source/drivers/mfd/sm501.c#L1711">http://lxr.free-electrons.com/source/drivers/mfd/sm501.c#L1711</a><br>&gt;<br>&gt; Since there is the MODULE_DEVICE_TABLE(), why  the author additionally adds the MODULE_ALIAS()?<br>&gt; What exactly is this MODULE_ALIAS() used for?<br><br>Short answer: to re-enable auto loading of the module, Please refer subject line here: <a href="https://lab.nexedi.cn/kirr/linux/commit/4f46d6e7e5ffbce0ee1d1a80767fdf45e56cc863"><br>https://lab.nexedi.cn/kirr/linux/commit/4f46d6e7e5ffbce0ee1d1a80767fdf45e56cc863</a><br><br></div>Long answer: <br><a href="https://kerneltweaks.wordpress.com/2014/03/30/platform-device-and-platform-driver-linux/">https://kerneltweaks.wordpress.com/2014/03/30/platform-device-and-platform-driver-linux/<br></a><br></div>References:<br></div>Review the section kmod vs kerneld: <a href="http://lpic2.unix.nl/ch02s03.html">http://lpic2.unix.nl/ch02s03.html <br></a></div><br>What is MODULE_ALIAS: <a href="http://stackoverflow.com/questions/22778879/what-is-module-alias-in-linux-device-driver-code"><br>http://stackoverflow.com/questions/22778879/what-is-module-alias-in-linux-device-driver-code</a><br><div><br></div><div>Review Alias section: <br><a href="https://wiki.debian.org/Modules#Automatic_loading_of_modules">https://wiki.debian.org/Modules#Automatic_loading_of_modules</a><br><br></div><div>Review Identifying Device Driver Modules: <a href="http://free-electrons.com/doc/udev.pdf"><br>http://free-electrons.com/doc/udev.pdf<br></a><br></div><div>Useful to know: <br>1 - <a href="https://frankpzh.wordpress.com/2011/04/16/kmod-udev-and-modprobe/">https://frankpzh.wordpress.com/2011/04/16/kmod-udev-and-modprobe/</a><br>2 - <a href="https://www.quora.com/What-is-the-difference-between-platform-device-drivers-and-normal-device-drivers">https://www.quora.com/What-is-the-difference-between-platform-device-drivers-and-normal-device-drivers</a><br>3 - <a href="http://www.atmel.com/Images/doc32098.pdf">http://www.atmel.com/Images/doc32098.pdf</a><br><br>Where it all began: <br><a href="http://www.linuxjournal.com/node/5604/print">http://www.linuxjournal.com/node/5604/print</a><br><br></div><div>Hope this helps.<br><br></div><div>Thanks - Aruna<br></div><div><br><br></div><div><div><div><div><br></div></div></div></div></div>