diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2006-06-26 03:27:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:32 -0400 |
commit | e55186fe5fad31962d0ea5ef267bf0c23d98abd4 (patch) | |
tree | cd9dc9399fbf82dc7b329980c291a17b5b5697bf /drivers/video/console | |
parent | 9a17917671d407d37bf23a527aa55acca3cb4735 (diff) |
[PATCH] Detaching fbcon: clean up exit code
To detach fbcon, it must also clean up all resources it allocated. This was
never done before because fbcon cannot be unloaded.
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/fbcon.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 746225bf8c44..0b742497055e 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -3112,6 +3112,49 @@ static void __exit fbcon_deinit_class_device(void) | |||
3112 | 3112 | ||
3113 | static void __exit fbcon_exit(void) | 3113 | static void __exit fbcon_exit(void) |
3114 | { | 3114 | { |
3115 | struct fb_info *info; | ||
3116 | int i, j, mapped; | ||
3117 | |||
3118 | for (i = 0; i < FB_MAX; i++) { | ||
3119 | info = registered_fb[i]; | ||
3120 | |||
3121 | if (info && info->fbcon_par) | ||
3122 | fbcon_del_cursor_timer(info); | ||
3123 | } | ||
3124 | |||
3125 | #ifdef CONFIG_ATARI | ||
3126 | free_irq(IRQ_AUTO_4, fbcon_vbl_handler); | ||
3127 | #endif | ||
3128 | #ifdef CONFIG_MAC | ||
3129 | if (MACH_IS_MAC && vbl_detected) | ||
3130 | free_irq(IRQ_MAC_VBL, fbcon_vbl_handler); | ||
3131 | #endif | ||
3132 | |||
3133 | kfree((void *)softback_buf); | ||
3134 | |||
3135 | for (i = 0; i < FB_MAX; i++) { | ||
3136 | mapped = 0; | ||
3137 | info = registered_fb[i]; | ||
3138 | |||
3139 | if (info == NULL) | ||
3140 | continue; | ||
3141 | |||
3142 | for (j = 0; j < MAX_NR_CONSOLES; j++) { | ||
3143 | if (con2fb_map[j] == i) { | ||
3144 | con2fb_map[j] = -1; | ||
3145 | mapped = 1; | ||
3146 | } | ||
3147 | } | ||
3148 | |||
3149 | if (mapped) { | ||
3150 | if (info->fbops->fb_release) | ||
3151 | info->fbops->fb_release(info, 0); | ||
3152 | module_put(info->fbops->owner); | ||
3153 | kfree(info->fbcon_par); | ||
3154 | info->fbcon_par = NULL; | ||
3155 | } | ||
3156 | } | ||
3157 | |||
3115 | fbcon_deinit_class_device(); | 3158 | fbcon_deinit_class_device(); |
3116 | class_device_destroy(fb_class, MKDEV(FB_MAJOR, FB_MAX)); | 3159 | class_device_destroy(fb_class, MKDEV(FB_MAJOR, FB_MAX)); |
3117 | } | 3160 | } |