From: Antonino Daplas <adaplas@pol.net>
To: James Simmons <jsimmons@infradead.org>
Cc: fbdev <linux-fbdev-devel@lists.sourceforge.net>
Subject: Module unloading
Date: 03 Nov 2002 05:33:42 +0800 [thread overview]
Message-ID: <1036272762.642.5.camel@daplas> (raw)
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
next reply other threads:[~2002-11-02 21:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-02 21:33 Antonino Daplas [this message]
2002-11-09 0:45 ` Module unloading James Simmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1036272762.642.5.camel@daplas \
--to=adaplas@pol.net \
--cc=jsimmons@infradead.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.