linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] newport_con: Fix resource acquisition
@ 2006-06-25 12:03 Antonino A. Daplas
  0 siblings, 0 replies; only message in thread
From: Antonino A. Daplas @ 2006-06-25 12:03 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Fbdev development list

newport_con can be compiled statically and assigned directly to conswitchp, or
it can be compiled as a module, in which case, it goes through the
take_over_console() pathway.

In the former, resource acquisition is done in newport_startup() and in the
latter, the resources are acquired in newport_console_init().

Fix so resources are properly acquired whatever pathway it goes through.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---

Andrew,

I reexamined the changes I made to the various console drivers to make
them work with dynamic VT binding. I discovered that newport_con can
be loaded in 2 ways, directly or via take_over_console().

The changes I made in vt-binding-make-newport_con-support-binding.patch
will work only if newport_con is compiled as a module.

You may choose to fold this with the above patch.

Tony

 drivers/video/console/newport_con.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c
index cc121dc..0304131 100644
--- a/drivers/video/console/newport_con.c
+++ b/drivers/video/console/newport_con.c
@@ -298,6 +298,12 @@ static const char *newport_startup(void)
 {
 	int i;
 
+	if (!sgi_gfxaddr)
+		return NULL;
+
+	if (!npregs)
+		npregs = (struct newport_regs *)/* ioremap cannot fail */
+			ioremap(sgi_gfxaddr, sizeof(struct newport_regs));
 	npregs->cset.config = NPORT_CFG_GD0;
 
 	if (newport_wait(npregs))
@@ -730,19 +736,21 @@ const struct consw newport_con = {
 	.con_save_screen  = DUMMY
 };
 
+#ifdef MODULE
 static int __init newport_console_init(void)
 {
 
 	if (!sgi_gfxaddr)
 		return NULL;
-	npregs = (struct newport_regs *)	/* ioremap cannot fail */
-		 ioremap(sgi_gfxaddr, sizeof(struct newport_regs));
+
+	if (!npregs)
+		npregs = (struct newport_regs *)/* ioremap cannot fail */
+			ioremap(sgi_gfxaddr, sizeof(struct newport_regs));
 
 	return take_over_console(&newport_con, 0, MAX_NR_CONSOLES - 1, 1);
 }
 module_init(newport_console_init);
 
-#ifdef MODULE
 static void __exit newport_console_exit(void)
 {
 	give_up_console(&newport_con);


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2006-06-25 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-25 12:03 [PATCH] newport_con: Fix resource acquisition Antonino A. Daplas

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).