module using another module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What is the correct/recommended way for one module to "plug in to" or use another module? e.g. if I have one module (call it A) which exports a symbol allowing a different module (call it B) to register (and unregister) a function pointer (which gets called by A if it has a valid value), it would be very good if A cannot unload while B is using it (registered), and also that B can unload without A being aware it has unregistered. The latter can simply be achieved by having B call the unregister function of A when it unloads. The former I suppose could be done via some sort of refcount scheme, but I'm sure this type of problem has a proper correct solution in the Linux kernel (e.g. all the modules that use the i2c module etc. etc.), and I'd obviously like to avoid re-inventing the wheel (badly).

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux