* Module unloading
@ 2002-11-02 21:33 Antonino Daplas
2002-11-09 0:45 ` James Simmons
0 siblings, 1 reply; 2+ messages in thread
From: Antonino Daplas @ 2002-11-02 21:33 UTC (permalink / raw)
To: James Simmons; +Cc: fbdev
Hi James,
Regarding your latest patch, if the framebuffer console is not defined,
then the module_use_count should not be incremented and the device
should not be opened. This will prevent the module from being unloaded.
Attached is a patch against 2.5.45 + your fbdev.diff.
Tony
diff -Naur linux-2.5.45-fbdev/drivers/video/fbmem.c linux/drivers/video/fbmem.c
--- linux-2.5.45-fbdev/drivers/video/fbmem.c Sat Nov 2 21:21:06 2002
+++ linux/drivers/video/fbmem.c Sat Nov 2 21:24:29 2002
@@ -726,8 +726,8 @@
int
register_framebuffer(struct fb_info *fb_info)
{
- static int fb_ever_opened[FB_MAX];
#ifdef CONFIG_FRAMEBUFFER_CONSOLE
+ static int fb_ever_opened[FB_MAX];
static int first = 1;
int j;
#endif
@@ -743,9 +743,9 @@
fb_info->node = mk_kdev(FB_MAJOR, i);
fb_info->currcon = -1;
registered_fb[i] = fb_info;
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE
if (!fb_ever_opened[i]) {
struct module *owner = fb_info->fbops->owner;
-#ifdef CONFIG_FRAMEBUFFER_CONSOLE
/*
* We assume initial frame buffer devices can be opened this
* many times
@@ -767,14 +767,6 @@
if (first) {
first = 0;
take_over_console(&fb_con, first_fb_vc, last_fb_vc, fbcon_is_default);
- }
-#else
- if (owner) {
- __MOD_INC_USE_COUNT(owner);
- if (fb_info->fbops->fb_open && fb_info->fbops->fb_open(fb_info,0))
- __MOD_DEC_USE_COUNT(owner);
- }
- fb_ever_opened[i] = 1;
}
#endif
sprintf (name_buf, "%d", i);
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Module unloading
2002-11-02 21:33 Module unloading Antonino Daplas
@ 2002-11-09 0:45 ` James Simmons
0 siblings, 0 replies; 2+ messages in thread
From: James Simmons @ 2002-11-09 0:45 UTC (permalink / raw)
To: Antonino Daplas; +Cc: fbdev
> Regarding your latest patch, if the framebuffer console is not defined,
> then the module_use_count should not be incremented and the device
> should not be opened. This will prevent the module from being unloaded.
>
> Attached is a patch against 2.5.45 + your fbdev.diff.
Applied and tested. I could insmod and rmmod various fbdev drivers.
Yeah!!!
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-09 0:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-02 21:33 Module unloading Antonino Daplas
2002-11-09 0:45 ` James Simmons
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).