]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
eth: 3c515: replace cleanup_module with __exit
authorShi Hao <i.shihao.999@gmail.com>
Sat, 18 Oct 2025 05:25:41 +0000 (10:55 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 22 Oct 2025 01:28:56 +0000 (18:28 -0700)
update old legacy cleanup_module from the file with __exit
module as per kernel code practices and restore the #ifdef
MODULE condition to allow successful compilation as a built
-in driver.

The file had an old cleanup_module still in use which could
be updated with __exit module function although its init_module
is indeed newer however the cleanup_module was still
using the older version of exit.

To set proper exit module function replace cleanup_module
with __exit corkscrew_exit_module to align it to the
kernel code consistency.

Signed-off-by: Shi Hao <i.shihao.999@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251018052541.124365-1-i.shihao.999@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/3com/3c515.c

index ecdea58e6a21f838675ba7ddb5b9023f6befa731..2227c83a486228e156feef4ffc536cb2c55fb001 100644 (file)
@@ -1547,9 +1547,8 @@ static const struct ethtool_ops netdev_ethtool_ops = {
        .set_msglevel           = netdev_set_msglevel,
 };
 
-
 #ifdef MODULE
-void cleanup_module(void)
+static void __exit corkscrew_exit_module(void)
 {
        while (!list_empty(&root_corkscrew_dev)) {
                struct net_device *dev;
@@ -1563,4 +1562,5 @@ void cleanup_module(void)
                free_netdev(dev);
        }
 }
+module_exit(corkscrew_exit_module);
 #endif                         /* MODULE */