I have written a character device driver in which the following functions
are there.
#ifndef MODULE
long zero_init(long mem_start, long mem_end)
{
..........
}
#else
int init_module(void)
{
..........
/* here I use register_chrdev() */
}
void cleanup_module(void)
{
.........
/* here I use unregister_chrdev() */
}
#endif
My doubt is this. I have a printk() function call in init_module. When I
compile the source I use -D option to define MODULE. But I am not getting
any output from printk() in init_module(). Why is this so ?
I believe init_module() is called when I do 'insmod'. Am I correct ?
If not, when is register_chrdev() called ? Is cleanup_module() called
when I do a 'rmmod' ??
Thank you,
regards
Satheesh
---------------------------------------------------------------------------
The human mind treats a new idea the way the body treats a strange protein-
--it rejects it.
---------------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html