mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Fulghum <paulkf@microgate.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Subject: Re: [BUG] 2.5.70 tty_register_driver
Date: 28 May 2003 14:27:38 -0500	[thread overview]
Message-ID: <1054150058.2025.18.camel@diemos> (raw)
In-Reply-To: <1054138158.2107.4.camel@diemos>

On Wed, 2003-05-28 at 11:09, Paul Fulghum wrote:
> There was a large patch applied in 2.5.70 to
> the tty layer that has broken registration of tty
> devices.

Below is the broken code that was added in 2.5.70
to the tty_register_driver() function in drivers/char/tty_io.c
(apparently submitted by Greg Kroah-Hartman <greg@kroah.com>)

If a tty device uses dynamic major device numbers
(driver->major set to zero), then the new code fails
to honor the driver->minor_start value. Previously
the driver->minor_start specified the starting device
minor number for all calls to tty_register_driver()
regardless of if major is dynamically allocated or
staticly specified.

The result is the device minor numbers change for
dynamically assigned major device numbers resulting
in a loss of compatibility.

tty_register_driver() should be fixed
(along with alloc_chrdev_region) to once again honor
the base minor number.
 
 	if (!driver->major) {
-		error = register_chrdev_region(0, driver->minor_start,
-				       driver->num, driver->name, &tty_fops);
-		if (error > 0)
-			driver->major = error;
+		error = alloc_chrdev_region(&dev, driver->num,
+						(char*)driver->name);
+		if (!error) {
+			driver->major = MAJOR(dev);
+			driver->minor_start = MINOR(dev);
+		}
 	} else {
-		error = get_range(driver);
+		dev = MKDEV(driver->major, driver->minor_start);
+		error = register_chrdev_region(dev, driver->num,
+						(char*)driver->name);
 	}


-- 
Paul Fulghum, paulkf@microgate.com
Microgate Corporation, http://www.microgate.com



  reply	other threads:[~2003-05-28 19:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-28 16:09 Paul Fulghum
2003-05-28 19:27 ` Paul Fulghum [this message]
2003-05-29 14:27   ` [PATCH] " Paul Fulghum
2003-05-29 16:56     ` Greg KH
2003-05-29 17:27       ` Paul Fulghum

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=1054150058.2025.18.camel@diemos \
    --to=paulkf@microgate.com \
    --cc=greg@kroah.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

all inboxes | Powered by JetHome®