From: Christoph Hellwig <hch@lst.de>

A bunch of framebuffer drivers use MOD_INC_USE_COUNT to prevent themselves
from unloading completely - but we have a much easier way to do so, that is
simply removing the module_exit/cleanup_module handler.


---

 25-akpm/drivers/video/atafb.c    |   11 -----------
 25-akpm/drivers/video/cyberfb.c  |    9 ---------
 25-akpm/drivers/video/retz3fb.c  |   12 ------------
 25-akpm/drivers/video/sa1100fb.c |    2 --
 25-akpm/drivers/video/virgefb.c  |    9 ---------
 5 files changed, 43 deletions(-)

diff -puN drivers/video/atafb.c~drivers-video-mod_inc_use_count-fixes drivers/video/atafb.c
--- 25/drivers/video/atafb.c~drivers-video-mod_inc_use_count-fixes	Fri May  7 15:11:57 2004
+++ 25-akpm/drivers/video/atafb.c	Fri May  7 15:11:57 2004
@@ -2819,8 +2819,6 @@ int __init atafb_init(void)
 	       fb_info.node, fb_info.modename, screen_len>>10);
 
 	/* TODO: This driver cannot be unloaded yet */
-	MOD_INC_USE_COUNT;
-
 	return 0;
 }
 
@@ -3097,13 +3095,4 @@ int init_module(void)
 {
 	return atafb_init();
 }
-
-void cleanup_module(void)
-{
-	/* Not reached because the usecount will never
-	   be decremented to zero */
-	unregister_framebuffer(&fb_info);
-	/* atari_stram_free( screen_base ); */
-	/* TODO: further clean up ... */
-}
 #endif /* MODULE */
diff -puN drivers/video/cyberfb.c~drivers-video-mod_inc_use_count-fixes drivers/video/cyberfb.c
--- 25/drivers/video/cyberfb.c~drivers-video-mod_inc_use_count-fixes	Fri May  7 15:11:57 2004
+++ 25-akpm/drivers/video/cyberfb.c	Fri May  7 15:11:57 2004
@@ -1065,7 +1065,6 @@ int __init cyberfb_init(void)
 		   fb_info.node, fb_info.modename, CyberSize>>10);
 
 	    /* TODO: This driver cannot be unloaded yet */
-	    MOD_INC_USE_COUNT;
 	    DPRINTK("EXIT\n");
 	    return 0;
 	}
@@ -1206,14 +1205,6 @@ int init_module(void)
 {
 	return cyberfb_init();
 }
-
-void cleanup_module(void)
-{
-	/* Not reached because the usecount will never be
-	   decremented to zero */
-	unregister_framebuffer(&fb_info);
-	/* TODO: clean up ... */
-}
 #endif /* MODULE */
 
 /*
diff -puN drivers/video/retz3fb.c~drivers-video-mod_inc_use_count-fixes drivers/video/retz3fb.c
--- 25/drivers/video/retz3fb.c~drivers-video-mod_inc_use_count-fixes	Fri May  7 15:11:57 2004
+++ 25-akpm/drivers/video/retz3fb.c	Fri May  7 15:11:57 2004
@@ -1432,8 +1432,6 @@ int __init retz3fb_init(void)
 		       fb_info->modename, zinfo->fbsize>>10);
 
 		/* FIXME: This driver cannot be unloaded yet */
-		MOD_INC_USE_COUNT;
-
 		res = 0;
 	}
 	return res;
@@ -1491,16 +1489,6 @@ int init_module(void)
 {
 	return retz3fb_init();
 }
-
-void cleanup_module(void)
-{
-	/*
-	 * Not reached because the usecount will never
-	 * be decremented to zero
-	 *
-	 * FIXME: clean up ... *
-	 */
-}
 #endif
 
 
diff -puN drivers/video/sa1100fb.c~drivers-video-mod_inc_use_count-fixes drivers/video/sa1100fb.c
--- 25/drivers/video/sa1100fb.c~drivers-video-mod_inc_use_count-fixes	Fri May  7 15:11:57 2004
+++ 25-akpm/drivers/video/sa1100fb.c	Fri May  7 15:11:57 2004
@@ -1765,8 +1765,6 @@ static int __init sa1100fb_probe(struct 
 #endif
 
 	/* This driver cannot be unloaded at the moment */
-	MOD_INC_USE_COUNT;
-
 	return 0;
 
 failed:
diff -puN drivers/video/virgefb.c~drivers-video-mod_inc_use_count-fixes drivers/video/virgefb.c
--- 25/drivers/video/virgefb.c~drivers-video-mod_inc_use_count-fixes	Fri May  7 15:11:57 2004
+++ 25-akpm/drivers/video/virgefb.c	Fri May  7 15:11:57 2004
@@ -1809,7 +1809,6 @@ int __init virgefb_init(void)
 
 	/* TODO: This driver cannot be unloaded yet */
 
-	MOD_INC_USE_COUNT;
 	DPRINTK("EXIT\n");
 	return 0;
 }
@@ -2064,14 +2063,6 @@ int init_module(void)
 {
 	return virgefb_init();
 }
-
-void cleanup_module(void)
-{
-	/* Not reached because the usecount will never be
-	   decremented to zero */
-	unregister_framebuffer(&fb_info);
-	/* TODO: clean up ... */
-}
 #endif /* MODULE */
 
 static int cv3d_has_4mb(void)

_