public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <p_gortmaker@yahoo.com>
To: linux-kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] mdacon needs to use __setup()
Date: Sat, 24 Mar 2001 04:23:13 -0500	[thread overview]
Message-ID: <3ABC6781.6FFEF3FA@yahoo.com> (raw)

The kernel command line setup function for MDA console support is
currently dangling in outer space and not called (and hence non
functional).  There was also a warning about a non used function
whose callers were half  /* */ 'ed out so I cleaned that up as well.

Patch should apply to any recent 2.4.x kernel.

Paul.

--- drivers/video/mdacon.c~	Wed Feb 14 02:41:44 2001
+++ drivers/video/mdacon.c	Mon Mar 12 19:37:21 2001
@@ -21,6 +21,9 @@
  *  This file is subject to the terms and conditions of the GNU General Public
  *  License.  See the file COPYING in the main directory of this archive for
  *  more details.
+ *
+ *  Changelog:
+ *  Paul G. (03/2001) Fix mdacon= boot prompt to use __setup().
  */
 
 #include <linux/types.h>
@@ -129,6 +132,7 @@
 	spin_unlock_irqrestore(&mda_lock, flags);
 }
 
+#ifdef TEST_MDA_B
 static int test_mda_b(unsigned char val, unsigned char reg)
 {
 	unsigned long flags;
@@ -143,6 +147,7 @@
 	spin_unlock_irqrestore(&mda_lock, flags);
 	return val;
 }
+#endif
 
 static inline void mda_set_origin(unsigned int location)
 {
@@ -182,20 +187,27 @@
 
 
 #ifndef MODULE
-void __init mdacon_setup(char *str, int *ints)
+static int __init mdacon_setup(char *str)
 {
 	/* command line format: mdacon=<first>,<last> */
 
+	int ints[3];
+
+	str = get_options(str, ARRAY_SIZE(ints), ints);
+
 	if (ints[0] < 2)
-		return;
+		return 0;
 
 	if (ints[1] < 1 || ints[1] > MAX_NR_CONSOLES || 
 	    ints[2] < 1 || ints[2] > MAX_NR_CONSOLES)
-		return;
+		return 0;
 
-	mda_first_vc = ints[1]-1;
-	mda_last_vc  = ints[2]-1;
+	mda_first_vc = ints[1];
+	mda_last_vc  = ints[2];
+	return 1;
 }
+
+__setup("mdacon=", mdacon_setup);
 #endif
 
 static int __init mda_detect(void)
@@ -237,17 +249,19 @@
 	 * memory location, so now we do an I/O port test.
 	 */
 
+#ifdef TEST_MDA_B
 	/* Edward: These two mess `tests' mess up my cursor on bootup */
 
 	/* cursor low register */
-	/* if (! test_mda_b(0x66, 0x0f)) {
+	if (! test_mda_b(0x66, 0x0f)) {
 		return 0;
-	} */
+	}
 
 	/* cursor low register */
-	/* if (! test_mda_b(0x99, 0x0f)) {
+	if (! test_mda_b(0x99, 0x0f)) {
 		return 0;
-	} */
+	}
+#endif
 
 	/* See if the card is a Hercules, by checking whether the vsync
 	 * bit of the status register is changing.  This test lasts for



                 reply	other threads:[~2001-03-24  9:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3ABC6781.6FFEF3FA@yahoo.com \
    --to=p_gortmaker@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox