Skip to content

Commit ab8e2eb

Browse files
committed
cyber2000fb.c: use proper method for stopping unload if CONFIG_ARCH_SHARK
Russell explains the __module_get(): > cyber2000fb.c does it in its module initialization function > to prevent the module (when built for Shark) from being unloaded. It > does this because it's from the days of 2.2 kernels and no one bothered > writing the module unload support for Shark. Since 2.4, the correct answer has been to not define an unload fn. Cc: Russell King <[email protected]> Cc: [email protected] Signed-off-by: Rusty Russell <[email protected]>
1 parent 8ebf975 commit ab8e2eb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/video/cyber2000fb.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,10 +1736,8 @@ static int __init cyber2000fb_init(void)
17361736

17371737
#ifdef CONFIG_ARCH_SHARK
17381738
err = cyberpro_vl_probe();
1739-
if (!err) {
1739+
if (!err)
17401740
ret = 0;
1741-
__module_get(THIS_MODULE);
1742-
}
17431741
#endif
17441742
#ifdef CONFIG_PCI
17451743
err = pci_register_driver(&cyberpro_driver);
@@ -1749,14 +1747,15 @@ static int __init cyber2000fb_init(void)
17491747

17501748
return ret ? err : 0;
17511749
}
1750+
module_init(cyber2000fb_init);
17521751

1752+
#ifndef CONFIG_ARCH_SHARK
17531753
static void __exit cyberpro_exit(void)
17541754
{
17551755
pci_unregister_driver(&cyberpro_driver);
17561756
}
1757-
1758-
module_init(cyber2000fb_init);
17591757
module_exit(cyberpro_exit);
1758+
#endif
17601759

17611760
MODULE_AUTHOR("Russell King");
17621761
MODULE_DESCRIPTION("CyberPro 2000, 2010 and 5000 framebuffer driver");

0 commit comments

Comments
 (0)