I ran into the line subsys_initcall(devfreq_init);
in the devfreq.c file of the Linux kernel. I was just wondering when it is actually called and what it does.
Asked
Active
Viewed 350 times
2

John Roberts
- 5,885
- 21
- 70
- 124
-
2`syssys_initcall()` and all *init* machinery is defined in [init.h](https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/include/linux/init.h). Basically they are tables put in a section and then called upon startup based on numbers in the table. *subsys* is after *arch* and before *fs* (filesystem). Also see `do_initcall_level()` in [main.c](https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/init/main.c) – artless noise Apr 13 '13 at 03:37
-
1See [What is the difference between module_init and subsys_initcall while initializing the driver?](http://stackoverflow.com/questions/15541290/what-is-the-difference-between-module-init-and-subsys-initcall-while-initializin/15542788#15542788) and [init function invocation of drivers compiled into kernel](http://stackoverflow.com/questions/12865054/init-function-invocation-of-drivers-compiled-into-kernel/12869195#12869195) – sawdust Apr 13 '13 at 23:43