How do I implement a use counter for 2.5 modules?

Marcel Offermans (marcel.offermans@luminis.nl)
Wed, 28 May 2003 12:03:11 +0200 (CEST)


I am currently porting a CAN driver module from 2.4 to 2.5 and one of the
things I did was remove the MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros
from the code. This now means that rmmod will remove my module even when
it is still in use. What mechanism should I use to prevent this? I know
how to logically detect if the module is in use (there's a variable that
keeps track of this already in the code), I just don't know what new API I
should use.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/