summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-06-05 18:54:35 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-06-05 18:54:35 -0700
commit7807eb6a554acb160137101afa71ebb81ac9c115 (patch)
treee248057cbac22aac2052a2ac2e3328f25bb4ea54 /drivers
parent9c481bc054a2031234c8d0e43566133d9c627b0a (diff)
[PATCH] Fix tty devfs mess
From: Christoph Hellwig <hch@lst.de> Currently the tty code abuses tty_driver.name as the prefix for the devfs names of the ttys. This is a very bad idea because it means the tty name changes depending on whether devfs is enabled or not, leading to different names in /proc/tty/ depending on whether we have devfs or not (and not whether it actually is mounted!) and a huge amount of ifdefs. The patch below adds a .devfs_name member instead, similar to the block device changes a few weeks ago.
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/dz.c5
-rw-r--r--drivers/char/ip2main.c21
-rw-r--r--drivers/char/pty.c10
-rw-r--r--drivers/char/rocket.c1
-rw-r--r--drivers/char/serial167.c5
-rw-r--r--drivers/char/sh-sci.c5
-rw-r--r--drivers/char/stallion.c8
-rw-r--r--drivers/char/tty_io.c40
-rw-r--r--drivers/char/vme_scc.c5
-rw-r--r--drivers/char/vt.c3
-rw-r--r--drivers/isdn/i4l/isdn_tty.c9
-rw-r--r--drivers/macintosh/macserial.c5
-rw-r--r--drivers/s390/net/ctctty.c13
-rw-r--r--drivers/serial/8250.c5
-rw-r--r--drivers/serial/core.c1
-rw-r--r--drivers/serial/nb85e_uart.c5
-rw-r--r--drivers/serial/sunsab.c5
-rw-r--r--drivers/serial/sunsu.c5
-rw-r--r--drivers/serial/sunzilog.c5
-rw-r--r--drivers/tc/zs.c5
-rw-r--r--drivers/usb/serial/usb-serial.c5
21 files changed, 38 insertions, 128 deletions
diff --git a/drivers/char/dz.c b/drivers/char/dz.c
index 24184e8cc08f..5b87268f803f 100644
--- a/drivers/char/dz.c
+++ b/drivers/char/dz.c
@@ -1295,11 +1295,8 @@ int __init dz_init(void)
memset(&serial_driver, 0, sizeof(struct tty_driver));
serial_driver.magic = TTY_DRIVER_MAGIC;
serial_driver.owner = THIS_MODULE;
-#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
+ serial_driver.devfs_name = "tts/";
serial_driver.name = "ttyS";
-#else
- serial_driver.name = "tts/";
-#endif
serial_driver.major = TTY_MAJOR;
serial_driver.minor_start = 64;
serial_driver.num = DZ_NB_PORT;
diff --git a/drivers/char/ip2main.c b/drivers/char/ip2main.c
index 1261865240f2..2799db8ee95d 100644
--- a/drivers/char/ip2main.c
+++ b/drivers/char/ip2main.c
@@ -94,9 +94,7 @@
#include <linux/module.h>
#include <linux/signal.h>
#include <linux/sched.h>
-#ifdef CONFIG_DEVFS_FS
#include <linux/devfs_fs_kernel.h>
-#endif
#include <linux/timer.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
@@ -229,11 +227,6 @@ static char *pcVersion = "1.2.14";
/* String constants for port names */
static char *pcDriver_name = "ip2";
-#ifdef CONFIG_DEVFS_FS
-static char *pcTty = "tts/F%d";
-#else
-static char *pcTty = "ttyF";
-#endif
static char *pcIpl = "ip2ipl";
/* Serial subtype definitions */
@@ -564,10 +557,7 @@ cleanup_module(void)
int
ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
{
-#ifdef CONFIG_DEVFS_FS
- int j, box;
-#endif
- int i;
+ int i, j, box;
int err;
int status = 0;
static int loaded;
@@ -786,7 +776,8 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
/* Initialise the relevant fields. */
ip2_tty_driver.magic = TTY_DRIVER_MAGIC;
ip2_tty_driver.owner = THIS_MODULE;
- ip2_tty_driver.name = pcTty;
+ ip2_tty_driver.name = "ttyF";
+ ip2_tty_driver.devfs_name = "tts/F";
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,1,0)
ip2_tty_driver.driver_name = pcDriver_name;
ip2_tty_driver.read_proc = ip2_read_proc;
@@ -798,11 +789,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
ip2_tty_driver.subtype = SERIAL_TYPE_NORMAL;
ip2_tty_driver.init_termios = tty_std_termios;
ip2_tty_driver.init_termios.c_cflag = B9600|CS8|CREAD|HUPCL|CLOCAL;
-#ifdef CONFIG_DEVFS_FS
ip2_tty_driver.flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
-#else
- ip2_tty_driver.flags = TTY_DRIVER_REAL_RAW;
-#endif
ip2_tty_driver.refcount = &ref_count;
ip2_tty_driver.table = TtyTable;
ip2_tty_driver.termios = Termios;
@@ -851,7 +838,6 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
continue;
}
-#ifdef CONFIG_DEVFS_FS
if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
@@ -874,7 +860,6 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
}
}
}
-#endif
if (poll_only) {
// Poll only forces driver to only use polling and
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index bb9286be8fe7..fa74f8c24d2d 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -347,11 +347,8 @@ int __init pty_init(void)
pty_driver.magic = TTY_DRIVER_MAGIC;
pty_driver.owner = THIS_MODULE;
pty_driver.driver_name = "pty_master";
-#ifdef CONFIG_DEVFS_FS
- pty_driver.name = "pty/m";
-#else
pty_driver.name = "pty";
-#endif
+ pty_driver.devfs_name = "pty/m";
pty_driver.major = PTY_MASTER_MAJOR;
pty_driver.minor_start = 0;
pty_driver.num = NR_PTYS;
@@ -382,11 +379,8 @@ int __init pty_init(void)
pty_slave_driver = pty_driver;
pty_slave_driver.driver_name = "pty_slave";
pty_slave_driver.proc_entry = 0;
-#ifdef CONFIG_DEVFS_FS
- pty_slave_driver.name = "pty/s";
-#else
pty_slave_driver.name = "ttyp";
-#endif
+ pty_slave_driver.devfs_name = "pty/s";
pty_slave_driver.subtype = PTY_TYPE_SLAVE;
pty_slave_driver.major = PTY_SLAVE_MAJOR;
pty_slave_driver.minor_start = 0;
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 78ea16a53550..17048a267d64 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -2650,6 +2650,7 @@ int __init rp_init(void)
memset(&rocket_driver, 0, sizeof (struct tty_driver));
rocket_driver.magic = TTY_DRIVER_MAGIC;
rocket_driver.flags = TTY_DRIVER_NO_DEVFS;
+ rocket_driver.devfs_name = "tts/R";
rocket_driver.name = "ttyR";
rocket_driver.driver_name = "Comtrol RocketPort";
rocket_driver.major = TTY_ROCKET_MAJOR;
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index e8fd977a227b..5ae35e3bd658 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -2359,11 +2359,8 @@ scrn[1] = '\0';
memset(&cy_serial_driver, 0, sizeof(struct tty_driver));
cy_serial_driver.magic = TTY_DRIVER_MAGIC;
cy_serial_driver.owner = THIS_MODULE;
-#ifdef CONFIG_DEVFS_FS
- cy_serial_driver.name = "tts/";
-#else
+ cy_serial_driver.devfs_name = "tts/";
cy_serial_driver.name = "ttyS";
-#endif
cy_serial_driver.major = TTY_MAJOR;
cy_serial_driver.minor_start = 64;
cy_serial_driver.num = NR_PORTS;
diff --git a/drivers/char/sh-sci.c b/drivers/char/sh-sci.c
index d3bb36a0cc9b..9091039dcdf1 100644
--- a/drivers/char/sh-sci.c
+++ b/drivers/char/sh-sci.c
@@ -994,11 +994,8 @@ static int sci_init_drivers(void)
sci_driver.magic = TTY_DRIVER_MAGIC;
sci_driver.owner = THIS_MODULE;
sci_driver.driver_name = "sci";
-#ifdef CONFIG_DEVFS_FS
- sci_driver.name = "ttsc/";
-#else
sci_driver.name = "ttySC";
-#endif
+ sci_driver.devfs_name = "ttsc/";
sci_driver.major = SCI_MAJOR;
sci_driver.minor_start = SCI_MINOR_START;
sci_driver.num = SCI_NPORTS;
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index b61904fda795..152aa0df988e 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -136,11 +136,6 @@ static int stl_nrbrds = sizeof(stl_brdconf) / sizeof(stlconf_t);
static char *stl_drvtitle = "Stallion Multiport Serial Driver";
static char *stl_drvname = "stallion";
static char *stl_drvversion = "5.6.0";
-#ifdef CONFIG_DEVFS_FS
-static char *stl_serialname = "tts/E%d";
-#else
-static char *stl_serialname = "ttyE";
-#endif
static struct tty_driver stl_serial;
static struct tty_struct *stl_ttys[STL_MAXDEVS];
@@ -3178,7 +3173,8 @@ int __init stl_init(void)
stl_serial.magic = TTY_DRIVER_MAGIC;
stl_serial.owner = THIS_MODULE;
stl_serial.driver_name = stl_drvname;
- stl_serial.name = stl_serialname;
+ stl_serial.name = "ttyE";
+ stl_serial.devfs_name = "tts/E";
stl_serial.major = STL_SERIALMAJOR;
stl_serial.minor_start = 0;
stl_serial.num = STL_MAXBRDS * STL_MAXPORTS;
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e68f219f9e62..5d47b9e74dad 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -2082,17 +2082,6 @@ static void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
tty->driver->write(tty, 0, &ch, 1);
}
-#ifdef CONFIG_DEVFS_FS
-static void tty_unregister_devfs(struct tty_driver *driver, int index)
-{
- char path[64];
- tty_line_name(driver, index, path);
- devfs_remove(path);
-}
-#else
-# define tty_unregister_devfs(driver, index) do { } while (0)
-#endif /* CONFIG_DEVFS_FS */
-
struct tty_dev {
struct list_head node;
dev_t dev;
@@ -2124,7 +2113,6 @@ static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
static void tty_add_class_device(char *name, dev_t dev, struct device *device)
{
struct tty_dev *tty_dev = NULL;
- char *temp;
int retval;
tty_dev = kmalloc(sizeof(*tty_dev), GFP_KERNEL);
@@ -2132,16 +2120,9 @@ static void tty_add_class_device(char *name, dev_t dev, struct device *device)
return;
memset(tty_dev, 0x00, sizeof(*tty_dev));
- /* stupid '/' in tty name strings... */
- temp = strrchr(name, '/');
- if (temp && (temp[1] != 0x00))
- ++temp;
- else
- temp = name;
-
tty_dev->class_dev.dev = device;
tty_dev->class_dev.class = &tty_class;
- snprintf(tty_dev->class_dev.class_id, BUS_ID_SIZE, "%s", temp);
+ snprintf(tty_dev->class_dev.class_id, BUS_ID_SIZE, "%s", name);
retval = class_device_register(&tty_dev->class_dev);
if (retval)
goto error;
@@ -2195,7 +2176,6 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
struct device *device)
{
dev_t dev = MKDEV(driver->major, driver->minor_start) + index;
- char name[64];
if (index >= driver->num) {
printk(KERN_ERR "Attempt to register invalid tty line number "
@@ -2203,16 +2183,16 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
return;
}
- tty_line_name(driver, index, name);
- devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, name);
-
- /* stupid console driver devfs names... change vc/X into ttyX */
- if (driver->type == TTY_DRIVER_TYPE_CONSOLE)
- sprintf(name, "tty%d", MINOR(dev));
+ devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
+ "%s%d", driver->devfs_name, index + driver->name_base);
/* we don't care about the ptys */
- if (driver->type != TTY_DRIVER_TYPE_PTY)
- tty_add_class_device (name, dev, device);
+ /* how nice to hide this behind some crappy interface.. */
+ if (driver->type != TTY_DRIVER_TYPE_PTY) {
+ char name[64];
+ tty_line_name(driver, index, name);
+ tty_add_class_device(name, dev, device);
+ }
}
/**
@@ -2225,7 +2205,7 @@ void tty_register_device(struct tty_driver *driver, unsigned index,
*/
void tty_unregister_device(struct tty_driver *driver, unsigned index)
{
- tty_unregister_devfs(driver, index);
+ devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
tty_remove_class_device(MKDEV(driver->major, driver->minor_start) + index);
}
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index b58b1ee3780c..26180a70ecba 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -131,11 +131,8 @@ static int scc_init_drivers(void)
scc_driver.magic = TTY_DRIVER_MAGIC;
scc_driver.owner = THIS_MODULE;
scc_driver.driver_name = "scc";
-#ifdef CONFIG_DEVFS_FS
- scc_driver.name = "tts/";
-#else
scc_driver.name = "ttyS";
-#endif
+ scc_driver.devfs_name = "tts/";
scc_driver.major = TTY_MAJOR;
scc_driver.minor_start = SCC_MINOR_BASE;
scc_driver.num = 2;
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 2ba239046503..31da2521143a 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -2531,7 +2531,8 @@ int __init vty_init(void)
memset(&console_driver, 0, sizeof(struct tty_driver));
console_driver.magic = TTY_DRIVER_MAGIC;
console_driver.owner = THIS_MODULE;
- console_driver.name = "vc/";
+ console_driver.devfs_name = "vc/";
+ console_driver.name = "tty";
console_driver.name_base = 1;
console_driver.major = TTY_MAJOR;
console_driver.minor_start = 1;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 3ab159fe1f13..58ae39f1dd7a 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -62,12 +62,6 @@ isdn_tty_event_callback(struct isdn_slot *slot, int pr, void *arg)
#define MODEM_PARANOIA_CHECK
#define MODEM_DO_RESTART
-#ifdef CONFIG_DEVFS_FS
-static char *isdn_ttyname_ttyI = "isdn/ttyI%d";
-#else
-static char *isdn_ttyname_ttyI = "ttyI";
-#endif
-
struct isdn_modem isdn_mdm;
static int bit2si[8] =
@@ -2013,7 +2007,8 @@ isdn_tty_init(void)
m = &isdn_mdm;
memset(&m->tty_modem, 0, sizeof(struct tty_driver));
m->tty_modem.magic = TTY_DRIVER_MAGIC;
- m->tty_modem.name = isdn_ttyname_ttyI;
+ m->tty_modem.name = "ttyI";
+ m->tty_modem.devfs_name = "isdn/ttyI";
m->tty_modem.major = ISDN_TTY_MAJOR;
m->tty_modem.minor_start = 0;
m->tty_modem.num = ISDN_MAX_CHANNELS;
diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c
index 8853777618e4..9bf7e50cfc89 100644
--- a/drivers/macintosh/macserial.c
+++ b/drivers/macintosh/macserial.c
@@ -2568,11 +2568,8 @@ no_dma:
serial_driver.magic = TTY_DRIVER_MAGIC;
serial_driver.owner = THIS_MODULE;
serial_driver.driver_name = "macserial";
-#ifdef CONFIG_DEVFS_FS
- serial_driver.name = "tts/";
-#else
+ serial_driver.devfs_name = "tts/";
serial_driver.name = "ttyS";
-#endif /* CONFIG_DEVFS_FS */
serial_driver.major = TTY_MAJOR;
serial_driver.minor_start = 64;
serial_driver.num = zs_channels_found;
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c
index 0c2365ad0c2b..a868cd2ab0dc 100644
--- a/drivers/s390/net/ctctty.c
+++ b/drivers/s390/net/ctctty.c
@@ -28,9 +28,7 @@
#include <linux/serial_reg.h>
#include <linux/interrupt.h>
#include <asm/uaccess.h>
-#ifdef CONFIG_DEVFS_FS
-# include <linux/devfs_fs_kernel.h>
-#endif
+#include <linux/devfs_fs_kernel.h>
#include "ctctty.h"
#define CTC_TTY_MAJOR 43
@@ -89,12 +87,6 @@ static ctc_tty_driver *driver;
#define CTC_TTY_NAME "ctctty"
-#ifdef CONFIG_DEVFS_FS
-static char *ctc_ttyname = "ctc/" CTC_TTY_NAME "%d";
-#else
-static char *ctc_ttyname = CTC_TTY_NAME;
-#endif
-
static __u32 ctc_tty_magic = CTC_ASYNC_MAGIC;
static int ctc_tty_shuttingdown = 0;
@@ -1170,7 +1162,8 @@ ctc_tty_init(void)
device = &driver->ctc_tty_device;
device->magic = TTY_DRIVER_MAGIC;
- device->name = ctc_ttyname;
+ device->devfs_name = "ctc/" CTC_TTY_NAME;
+ device->name = CTC_TTY_NAME;
device->major = CTC_TTY_MAJOR;
device->minor_start = 0;
device->num = CTC_TTY_MAX_DEVICES;
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index b554e894f79d..5aa42b8842ec 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1999,11 +1999,8 @@ console_initcall(serial8250_console_init);
static struct uart_driver serial8250_reg = {
.owner = THIS_MODULE,
.driver_name = "serial",
-#ifdef CONFIG_DEVFS_FS
- .dev_name = "tts/",
-#else
+ .devfs_name = "tts/",
.dev_name = "ttyS",
-#endif
.major = TTY_MAJOR,
.minor = 64,
.nr = UART_NR,
diff --git a/drivers/serial/core.c b/drivers/serial/core.c
index 3df5db0c4a59..7a40034c9cb7 100644
--- a/drivers/serial/core.c
+++ b/drivers/serial/core.c
@@ -2115,6 +2115,7 @@ int uart_register_driver(struct uart_driver *drv)
normal->magic = TTY_DRIVER_MAGIC;
normal->owner = drv->owner;
normal->driver_name = drv->driver_name;
+ normal->devfs_name = drv->devfs_name;
normal->name = drv->dev_name;
normal->major = drv->major;
normal->minor_start = drv->minor;
diff --git a/drivers/serial/nb85e_uart.c b/drivers/serial/nb85e_uart.c
index 1d9da1d786d4..883be05241df 100644
--- a/drivers/serial/nb85e_uart.c
+++ b/drivers/serial/nb85e_uart.c
@@ -524,11 +524,8 @@ static struct uart_ops nb85e_uart_ops = {
static struct uart_driver nb85e_uart_driver = {
.owner = THIS_MODULE,
.driver_name = "nb85e_uart",
-#ifdef CONFIG_DEVFS_FS
- .dev_name = "tts/",
-#else
+ .devfs_name = "tts/",
.dev_name = "ttyS",
-#endif
.major = TTY_MAJOR,
.minor = NB85E_UART_MINOR_BASE,
.nr = NB85E_UART_NUM_CHANNELS,
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 3825912884ae..f69dccdfc530 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -830,11 +830,8 @@ static struct uart_ops sunsab_pops = {
static struct uart_driver sunsab_reg = {
.owner = THIS_MODULE,
.driver_name = "serial",
-#ifdef CONFIG_DEVFS_FS
- .dev_name = "tts/",
-#else
+ .devfs_name = "tts/",
.dev_name = "ttyS",
-#endif
.major = TTY_MAJOR,
};
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 91c3b6233d42..8a42e34130f5 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1285,11 +1285,8 @@ out:
static struct uart_driver sunsu_reg = {
.owner = THIS_MODULE,
.driver_name = "serial",
-#ifdef CONFIG_DEVFS_FS
- .dev_name = "tts/",
-#else
+ .devfs_name = "tts/",
.dev_name = "ttyS",
-#endif
.major = TTY_MAJOR,
};
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index d91ae7dd5b27..8a5bcd6e19b3 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1030,11 +1030,8 @@ static int zilog_irq = -1;
static struct uart_driver sunzilog_reg = {
.owner = THIS_MODULE,
.driver_name = "ttyS",
-#ifdef CONFIG_DEVFS_FS
- .dev_name = "tts/",
-#else
+ .devfs_name = "tts/",
.dev_name = "ttyS",
-#endif
.major = TTY_MAJOR,
};
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 2b4546dab4a1..d4e0c26c4263 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -1840,11 +1840,8 @@ int __init zs_init(void)
memset(&serial_driver, 0, sizeof(struct tty_driver));
serial_driver.magic = TTY_DRIVER_MAGIC;
serial_driver.owner = THIS_MODULE;
-#if (LINUX_VERSION_CODE > 0x2032D && defined(CONFIG_DEVFS_FS))
- serial_driver.name = "tts/";
-#else
+ serial_driver.devfs_name = "tts/";
serial_driver.name = "ttyS";
-#endif
serial_driver.major = TTY_MAJOR;
serial_driver.minor_start = 64;
serial_driver.num = zs_channels_found;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 001cf793d6c0..d154003e540e 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -1304,11 +1304,8 @@ struct tty_driver usb_serial_tty_driver = {
.magic = TTY_DRIVER_MAGIC,
.owner = THIS_MODULE,
.driver_name = "usbserial",
-#ifndef CONFIG_DEVFS_FS
+ .devfs_name = "usb/tts/",
.name = "ttyUSB",
-#else
- .name = "usb/tts/",
-#endif
.major = SERIAL_TTY_MAJOR,
.minor_start = 0,
.num = SERIAL_TTY_MINORS,