Re: Little patch for 8390 driver

Jacques Gelinas (jack@solucorp.qc.ca)
Tue, 3 Dec 1996 22:47:50 -0500 (EST)


On Tue, 3 Dec 1996, Bas Mevissen wrote:

> Last week I mailed a remark to the list that the mod-in-use count for the
> 8390-chip module keeps 0. I use a Realtek NE2000 PCI card, which uses the
> ne.o driver, which, in turn uses the 8390.o driver.
>
> So the mod-in-use count should be 1. I found out why: namely, the macro that
> updates the count is missing. I fixed it (it's simple) and here it is:
>
> --- linux/drivers/net/8390.c Sat May 18 10:15:09 1996
> +++ 8390.c Mon Sep 2 23:07:44 1996
> @@ -812,12 +812,14 @@
>
> int init_module(void)
> {
> + MOD_INC_USE_COUNT;
> return 0;
> }
>
> void
> cleanup_module(void)
> {
> + MOD_DEC_USE_COUNT;
> }
> #endif /* MODULE */

By doing so, you won't be able to remove the module after that. While the
module has a usage count of 0, there are module dependancies which prevent
removal until those module are gone. The 8390 is not really a driver (a
device) but a library of function shared between different drivers, so it
has no real usage count.

I think the current situation is correct and your patch is not needed. On
my system, /proc/modules shows (stripped version)

ne 2 1
8390 2 [ne] 0

You can't rmmod (modprobe -r) a module with a usage count > 0.

--------------------------------------------------------
Jacques Gelinas (jacques@solucorp.qc.ca)
Linuxconf: The ultimate administration system for Linux.
see http://www.solucorp.qc.ca/linuxconf