Commit 766ab5a1 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] removal of MOD_{INC,DEC}_USE_COUNT in ide-cs.c

From: Pavel Roskin <proski@gnu.org>

The "ide-cs" module cannot be unloaded because it uses obsolete
MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros.  In fact, they are not
needed in ide-cs.c in 2.6 kernels.  The generic PCMCIA code already
increases use count for every device served by the driver, so it's
impossible to unload the ide-cs driver while it's in use.

I was told that the removal of IDE interfaces may be unsafe in 2.6
kernels.  However, MOD_INC_USE_COUNT only prevents removal of the module,
not the interface.  It's also the first obstacle, albeit a trivial one,
for anybody debugging those problems (i.e. loading a modified module
requires "rmmod -f" or reboot to unload the old version).
parent cbf67c1c
...@@ -362,7 +362,6 @@ void ide_config(dev_link_t *link) ...@@ -362,7 +362,6 @@ void ide_config(dev_link_t *link)
goto failed; goto failed;
} }
MOD_INC_USE_COUNT;
info->ndev = 1; info->ndev = 1;
sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2)); sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2));
info->node.major = ide_major[hd]; info->node.major = ide_major[hd];
...@@ -408,7 +407,6 @@ void ide_release(dev_link_t *link) ...@@ -408,7 +407,6 @@ void ide_release(dev_link_t *link)
if (link->io.NumPorts2) if (link->io.NumPorts2)
request_region(link->io.BasePort2, link->io.NumPorts2, request_region(link->io.BasePort2, link->io.NumPorts2,
info->node.dev_name); info->node.dev_name);
MOD_DEC_USE_COUNT;
} }
info->ndev = 0; info->ndev = 0;
link->dev = NULL; link->dev = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment