Module unloading
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
drivers/video/fbmem.c +2 -10
@@ -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
Quoted 6 lines
Regarding your latest patch, if the framebuffer console is not defined, then the
module_use_countshould 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