@@ -3504,12 +3504,24 @@ void __init console_init(void)
static char *tty_devnode(struct device *dev, umode_t *mode)
{
+ struct tty_driver *driver = NULL;
+ int unused;
+ char *ret = NULL;
+
+ mutex_lock(&tty_mutex);
+ driver = get_tty_driver(dev->devt, &unused);
+ mutex_unlock(&tty_mutex);
+ if (driver && driver->devnode)
+ ret = driver->devnode(dev, mode);
+ if (driver)
+ tty_driver_kref_put(driver);
+
if (!mode)
- return NULL;
+ return ret;
if (dev->devt == MKDEV(TTYAUX_MAJOR, 0) ||
dev->devt == MKDEV(TTYAUX_MAJOR, 2))
*mode = 0666;
- return NULL;
+ return ret;
}
static int __init tty_class_init(void)
@@ -294,6 +294,7 @@ struct tty_driver {
struct module *owner;
const char *driver_name;
const char *name;
+ char *(*devnode)(struct device *dev, umode_t *mode);
int name_base; /* offset of printed name */
int major; /* major device number */
int minor_start; /* start of minor device number */