[PATCH] 2.5.70 tty_register_driver

From: Paul Fulghum (paulkf@microgate.com)
Date: Thu May 29 2003 - 09:30:41 EST


This patch corrects changes made in 2.5.70 to
tty_register_device() which caused the device
minor base specified by tty drivers using dynamically
allocated device major number to be ignored.

I have posted to lkml and to the originator of the
2.5.70 patch, and have received no dissenting views.

Please apply.

--- linux-2.5.70/drivers/char/tty_io.c 2003-05-29 09:14:30.000000000 -0500
+++ linux-2.5.70-mg/drivers/char/tty_io.c 2003-05-29 08:24:41.000000000 -0500
@@ -2255,7 +2255,7 @@
return 0;

if (!driver->major) {
- error = alloc_chrdev_region(&dev, driver->num,
+ error = alloc_chrdev_region(&dev, driver->minor_start, driver->num,
(char*)driver->name);
if (!error) {
driver->major = MAJOR(dev);
--- linux-2.5.70/include/linux/fs.h 2003-05-29 09:14:01.000000000 -0500
+++ linux-2.5.70-mg/include/linux/fs.h 2003-05-29 08:23:46.000000000 -0500
@@ -1059,7 +1059,7 @@
extern void blk_run_queues(void);

/* fs/char_dev.c */
-extern int alloc_chrdev_region(dev_t *, unsigned, char *);
+extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, char *);
extern int register_chrdev_region(dev_t, unsigned, char *);
extern int register_chrdev(unsigned int, const char *,
struct file_operations *);
--- linux-2.5.70/fs/char_dev.c 2003-05-29 09:14:18.000000000 -0500
+++ linux-2.5.70-mg/fs/char_dev.c 2003-05-29 08:24:25.000000000 -0500
@@ -177,10 +177,10 @@
return PTR_ERR(cd);
}

-int alloc_chrdev_region(dev_t *dev, unsigned count, char *name)
+int alloc_chrdev_region(dev_t *dev, unsigned baseminor, unsigned count, char *name)
{
struct char_device_struct *cd;
- cd = __register_chrdev_region(0, 0, count, name);
+ cd = __register_chrdev_region(0, baseminor, count, name);
if (IS_ERR(cd))
return PTR_ERR(cd);
*dev = MKDEV(cd->major, cd->baseminor);




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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/