Commit 9ac2ca13 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

TTY: Change tty_*register_devfs() to tty_*register_device()

Also got rid of the unused flag paramater.
parent 99a6e15b
...@@ -2682,9 +2682,9 @@ static int __init rs_init(void) ...@@ -2682,9 +2682,9 @@ static int __init rs_init(void)
(state->flags & ASYNC_FOURPORT) ? " FourPort" : "", (state->flags & ASYNC_FOURPORT) ? " FourPort" : "",
state->port, state->irq, state->port, state->irq,
uart_config[state->type].name); uart_config[state->type].name);
tty_register_devfs(&serial_driver, 0, tty_register_device(&serial_driver,
serial_driver.minor_start + state->line); serial_driver.minor_start + state->line);
tty_register_devfs(&callout_driver, 0, tty_register_device(&callout_driver,
callout_driver.minor_start + state->line); callout_driver.minor_start + state->line);
} }
return 0; return 0;
...@@ -2772,9 +2772,9 @@ int register_serial(struct serial_struct *req) ...@@ -2772,9 +2772,9 @@ int register_serial(struct serial_struct *req)
state->iomem_base ? "iomem" : "port", state->iomem_base ? "iomem" : "port",
state->iomem_base ? (unsigned long)state->iomem_base : state->iomem_base ? (unsigned long)state->iomem_base :
state->port, state->irq, uart_config[state->type].name); state->port, state->irq, uart_config[state->type].name);
tty_register_devfs(&serial_driver, 0, tty_register_device(&serial_driver,
serial_driver.minor_start + state->line); serial_driver.minor_start + state->line);
tty_register_devfs(&callout_driver, 0, tty_register_device(&callout_driver,
callout_driver.minor_start + state->line); callout_driver.minor_start + state->line);
return state->line + SERIAL_DEV_OFFSET; return state->line + SERIAL_DEV_OFFSET;
} }
...@@ -2801,9 +2801,9 @@ void unregister_serial(int line) ...@@ -2801,9 +2801,9 @@ void unregister_serial(int line)
/* These will be hidden, because they are devices that will no longer /* These will be hidden, because they are devices that will no longer
* be available to the system. (ie, PCMCIA modems, once ejected) * be available to the system. (ie, PCMCIA modems, once ejected)
*/ */
tty_unregister_devfs(&serial_driver, tty_unregister_device(&serial_driver,
serial_driver.minor_start + state->line); serial_driver.minor_start + state->line);
tty_unregister_devfs(&callout_driver, tty_unregister_device(&callout_driver,
callout_driver.minor_start + state->line); callout_driver.minor_start + state->line);
restore_flags(flags); restore_flags(flags);
} }
......
...@@ -1425,9 +1425,9 @@ int __init dz_init(void) ...@@ -1425,9 +1425,9 @@ int __init dz_init(void)
printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line, printk("ttyS%02d at 0x%08x (irq = %d)\n", info->line,
info->port, SERIAL); info->port, SERIAL);
tty_register_devfs(&serial_driver, 0, tty_register_device(&serial_driver,
serial_driver.minor_start + info->line); serial_driver.minor_start + info->line);
tty_register_devfs(&callout_driver, 0, tty_register_device(&callout_driver,
callout_driver.minor_start + info->line); callout_driver.minor_start + info->line);
} }
......
...@@ -279,7 +279,7 @@ int __init hvc_init(void) ...@@ -279,7 +279,7 @@ int __init hvc_init(void)
for (i = 0; i < hvc_driver.num; i++) { for (i = 0; i < hvc_driver.num; i++) {
hvc_struct[i].lock = SPIN_LOCK_UNLOCKED; hvc_struct[i].lock = SPIN_LOCK_UNLOCKED;
hvc_struct[i].index = i; hvc_struct[i].index = i;
tty_register_devfs(&hvc_driver, 0, hvc_driver.minor_start + i); tty_register_device(&hvc_driver, hvc_driver.minor_start + i);
} }
if (tty_register_driver(&hvc_driver)) if (tty_register_driver(&hvc_driver))
......
...@@ -899,11 +899,11 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) ...@@ -899,11 +899,11 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
{ {
if ( pB->i2eChannelMap[box] & (1 << j) ) if ( pB->i2eChannelMap[box] & (1 << j) )
{ {
tty_register_devfs(&ip2_tty_driver, tty_register_device(&ip2_tty_driver,
0, j + ABS_BIGGEST_BOX * j + ABS_BIGGEST_BOX *
(box+i*ABS_MAX_BOXES)); (box+i*ABS_MAX_BOXES));
tty_register_devfs(&ip2_callout_driver, tty_register_device(&ip2_callout_driver,
0, j + ABS_BIGGEST_BOX * j + ABS_BIGGEST_BOX *
(box+i*ABS_MAX_BOXES)); (box+i*ABS_MAX_BOXES));
} }
} }
......
...@@ -97,7 +97,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp) ...@@ -97,7 +97,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
} }
} }
#endif #endif
tty_unregister_devfs (&tty->link->driver, minor(tty->device)); tty_unregister_device (&tty->link->driver, minor(tty->device));
tty_vhangup(tty->link); tty_vhangup(tty->link);
} }
} }
...@@ -307,6 +307,7 @@ static void pty_flush_buffer(struct tty_struct *tty) ...@@ -307,6 +307,7 @@ static void pty_flush_buffer(struct tty_struct *tty)
} }
} }
extern void tty_register_devfs (struct tty_driver *driver, unsigned int flags, unsigned minor);
static int pty_open(struct tty_struct *tty, struct file * filp) static int pty_open(struct tty_struct *tty, struct file * filp)
{ {
int retval; int retval;
......
...@@ -1351,7 +1351,7 @@ static int tty_open(struct inode * inode, struct file * filp) ...@@ -1351,7 +1351,7 @@ static int tty_open(struct inode * inode, struct file * filp)
set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */ set_bit(TTY_PTY_LOCK, &tty->flags); /* LOCK THE SLAVE */
minor -= driver->minor_start; minor -= driver->minor_start;
devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start)); devpts_pty_new(driver->other->name_base + minor, MKDEV(driver->other->major, minor + driver->other->minor_start));
tty_register_devfs(&pts_driver[major], DEVFS_FL_DEFAULT, tty_register_device(&pts_driver[major],
pts_driver[major].minor_start + minor); pts_driver[major].minor_start + minor);
noctty = 1; noctty = 1;
goto init_dev_done; goto init_dev_done;
...@@ -2038,9 +2038,6 @@ void tty_default_put_char(struct tty_struct *tty, unsigned char ch) ...@@ -2038,9 +2038,6 @@ void tty_default_put_char(struct tty_struct *tty, unsigned char ch)
tty->driver.write(tty, 0, &ch, 1); tty->driver.write(tty, 0, &ch, 1);
} }
/*
* Register a tty device described by <driver>, with minor number <minor>.
*/
void tty_register_devfs (struct tty_driver *driver, unsigned int flags, unsigned minor) void tty_register_devfs (struct tty_driver *driver, unsigned int flags, unsigned minor)
{ {
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
...@@ -2077,8 +2074,21 @@ void tty_unregister_devfs (struct tty_driver *driver, unsigned minor) ...@@ -2077,8 +2074,21 @@ void tty_unregister_devfs (struct tty_driver *driver, unsigned minor)
devfs_remove(driver->name, minor-driver->minor_start+driver->name_base); devfs_remove(driver->name, minor-driver->minor_start+driver->name_base);
} }
EXPORT_SYMBOL(tty_register_devfs); /*
EXPORT_SYMBOL(tty_unregister_devfs); * Register a tty device described by <driver>, with minor number <minor>.
*/
void tty_register_device (struct tty_driver *driver, unsigned minor)
{
tty_register_devfs(driver, 0, minor);
}
void tty_unregister_device (struct tty_driver *driver, unsigned minor)
{
tty_unregister_devfs(driver, minor);
}
EXPORT_SYMBOL(tty_register_device);
EXPORT_SYMBOL(tty_unregister_device);
/* /*
* Called by a tty driver to register itself. * Called by a tty driver to register itself.
...@@ -2104,7 +2114,7 @@ int tty_register_driver(struct tty_driver *driver) ...@@ -2104,7 +2114,7 @@ int tty_register_driver(struct tty_driver *driver)
if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) { if ( !(driver->flags & TTY_DRIVER_NO_DEVFS) ) {
for(i = 0; i < driver->num; i++) for(i = 0; i < driver->num; i++)
tty_register_devfs(driver, 0, driver->minor_start + i); tty_register_device(driver, driver->minor_start + i);
} }
proc_tty_register_driver(driver); proc_tty_register_driver(driver);
return error; return error;
...@@ -2159,7 +2169,7 @@ int tty_unregister_driver(struct tty_driver *driver) ...@@ -2159,7 +2169,7 @@ int tty_unregister_driver(struct tty_driver *driver)
driver->termios_locked[i] = NULL; driver->termios_locked[i] = NULL;
kfree(tp); kfree(tp);
} }
tty_unregister_devfs(driver, driver->minor_start + i); tty_unregister_device(driver, driver->minor_start + i);
} }
proc_tty_unregister_driver(driver); proc_tty_unregister_driver(driver);
return 0; return 0;
......
...@@ -2646,7 +2646,7 @@ static void __init con_init_devfs (void) ...@@ -2646,7 +2646,7 @@ static void __init con_init_devfs (void)
int i; int i;
for (i = 0; i < console_driver.num; i++) for (i = 0; i < console_driver.num; i++)
tty_register_devfs (&console_driver, DEVFS_FL_DEFAULT, tty_register_device (&console_driver,
console_driver.minor_start + i); console_driver.minor_start + i);
} }
......
...@@ -2098,7 +2098,7 @@ __uart_register_port(struct uart_driver *drv, struct uart_state *state, ...@@ -2098,7 +2098,7 @@ __uart_register_port(struct uart_driver *drv, struct uart_state *state,
* Register the port whether it's detected or not. This allows * Register the port whether it's detected or not. This allows
* setserial to be used to alter this ports parameters. * setserial to be used to alter this ports parameters.
*/ */
tty_register_devfs(drv->tty_driver, 0, drv->minor + port->line); tty_register_device(drv->tty_driver, drv->minor + port->line);
if (port->type != PORT_UNKNOWN) { if (port->type != PORT_UNKNOWN) {
unsigned long flags; unsigned long flags;
...@@ -2155,7 +2155,7 @@ __uart_unregister_port(struct uart_driver *drv, struct uart_state *state) ...@@ -2155,7 +2155,7 @@ __uart_unregister_port(struct uart_driver *drv, struct uart_state *state)
/* /*
* Remove the devices from devfs * Remove the devices from devfs
*/ */
tty_unregister_devfs(drv->tty_driver, drv->minor + port->line); tty_unregister_device(drv->tty_driver, drv->minor + port->line);
/* /*
* Free the port IO and memory resources, if any. * Free the port IO and memory resources, if any.
......
...@@ -1971,9 +1971,9 @@ int __init zs_init(void) ...@@ -1971,9 +1971,9 @@ int __init zs_init(void)
printk("ttyS%02d at 0x%08x (irq = %d)", info->line, printk("ttyS%02d at 0x%08x (irq = %d)", info->line,
info->port, info->irq); info->port, info->irq);
printk(" is a Z85C30 SCC\n"); printk(" is a Z85C30 SCC\n");
tty_register_devfs(&serial_driver, 0, tty_register_device(&serial_driver,
serial_driver.minor_start + info->line); serial_driver.minor_start + info->line);
tty_register_devfs(&callout_driver, 0, tty_register_device(&callout_driver,
callout_driver.minor_start + info->line); callout_driver.minor_start + info->line);
} }
......
...@@ -1201,7 +1201,7 @@ static int usb_bluetooth_probe (struct usb_interface *intf, ...@@ -1201,7 +1201,7 @@ static int usb_bluetooth_probe (struct usb_interface *intf,
bluetooth, endpoint->bInterval); bluetooth, endpoint->bInterval);
/* initialize the devfs nodes for this device and let the user know what bluetooths we are bound to */ /* initialize the devfs nodes for this device and let the user know what bluetooths we are bound to */
tty_register_devfs (&bluetooth_tty_driver, 0, minor); tty_register_device (&bluetooth_tty_driver, minor);
info("Bluetooth converter now attached to ttyUB%d (or usb/ttub/%d for devfs)", minor, minor); info("Bluetooth converter now attached to ttyUB%d (or usb/ttub/%d for devfs)", minor, minor);
bluetooth_table[minor] = bluetooth; bluetooth_table[minor] = bluetooth;
...@@ -1267,7 +1267,7 @@ static void usb_bluetooth_disconnect(struct usb_interface *intf) ...@@ -1267,7 +1267,7 @@ static void usb_bluetooth_disconnect(struct usb_interface *intf)
if (bluetooth->interrupt_in_buffer) if (bluetooth->interrupt_in_buffer)
kfree (bluetooth->interrupt_in_buffer); kfree (bluetooth->interrupt_in_buffer);
tty_unregister_devfs (&bluetooth_tty_driver, bluetooth->minor); tty_unregister_device (&bluetooth_tty_driver, bluetooth->minor);
for (i = 0; i < NUM_BULK_URBS; ++i) { for (i = 0; i < NUM_BULK_URBS; ++i) {
if (bluetooth->write_urb_pool[i]) { if (bluetooth->write_urb_pool[i]) {
......
...@@ -361,7 +361,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp) ...@@ -361,7 +361,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
usb_unlink_urb(acm->writeurb); usb_unlink_urb(acm->writeurb);
usb_unlink_urb(acm->readurb); usb_unlink_urb(acm->readurb);
} else { } else {
tty_unregister_devfs(&acm_tty_driver, acm->minor); tty_unregister_device(&acm_tty_driver, acm->minor);
acm_table[acm->minor] = NULL; acm_table[acm->minor] = NULL;
usb_free_urb(acm->ctrlurb); usb_free_urb(acm->ctrlurb);
usb_free_urb(acm->readurb); usb_free_urb(acm->readurb);
...@@ -649,7 +649,7 @@ static int acm_probe (struct usb_interface *intf, ...@@ -649,7 +649,7 @@ static int acm_probe (struct usb_interface *intf,
usb_driver_claim_interface(&acm_driver, acm->iface + 0, acm); usb_driver_claim_interface(&acm_driver, acm->iface + 0, acm);
usb_driver_claim_interface(&acm_driver, acm->iface + 1, acm); usb_driver_claim_interface(&acm_driver, acm->iface + 1, acm);
tty_register_devfs(&acm_tty_driver, 0, minor); tty_register_device(&acm_tty_driver, minor);
acm_table[minor] = acm; acm_table[minor] = acm;
dev_set_drvdata (&intf->dev, acm); dev_set_drvdata (&intf->dev, acm);
...@@ -681,7 +681,7 @@ static void acm_disconnect(struct usb_interface *intf) ...@@ -681,7 +681,7 @@ static void acm_disconnect(struct usb_interface *intf)
usb_driver_release_interface(&acm_driver, acm->iface + 1); usb_driver_release_interface(&acm_driver, acm->iface + 1);
if (!acm->used) { if (!acm->used) {
tty_unregister_devfs(&acm_tty_driver, acm->minor); tty_unregister_device(&acm_tty_driver, acm->minor);
acm_table[acm->minor] = NULL; acm_table[acm->minor] = NULL;
usb_free_urb(acm->ctrlurb); usb_free_urb(acm->ctrlurb);
usb_free_urb(acm->readurb); usb_free_urb(acm->readurb);
......
...@@ -78,7 +78,7 @@ static int usb_serial_device_probe (struct device *dev) ...@@ -78,7 +78,7 @@ static int usb_serial_device_probe (struct device *dev)
minor = port->number; minor = port->number;
tty_register_devfs (&usb_serial_tty_driver, 0, minor); tty_register_device (&usb_serial_tty_driver, minor);
info("%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)", info("%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)",
driver->name, minor, minor); driver->name, minor, minor);
...@@ -110,7 +110,7 @@ static int usb_serial_device_remove (struct device *dev) ...@@ -110,7 +110,7 @@ static int usb_serial_device_remove (struct device *dev)
} }
exit: exit:
minor = port->number; minor = port->number;
tty_unregister_devfs (&usb_serial_tty_driver, minor); tty_unregister_device (&usb_serial_tty_driver, minor);
info("%s converter now disconnected from ttyUSB%d", info("%s converter now disconnected from ttyUSB%d",
driver->name, minor); driver->name, minor);
......
...@@ -379,9 +379,8 @@ extern void start_tty(struct tty_struct * tty); ...@@ -379,9 +379,8 @@ extern void start_tty(struct tty_struct * tty);
extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
extern int tty_register_driver(struct tty_driver *driver); extern int tty_register_driver(struct tty_driver *driver);
extern int tty_unregister_driver(struct tty_driver *driver); extern int tty_unregister_driver(struct tty_driver *driver);
extern void tty_register_devfs (struct tty_driver *driver, unsigned int flags, extern void tty_register_device(struct tty_driver *driver, unsigned minor);
unsigned minor); extern void tty_unregister_device(struct tty_driver *driver, unsigned minor);
extern void tty_unregister_devfs (struct tty_driver *driver, unsigned minor);
extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
int buflen); int buflen);
extern void tty_write_message(struct tty_struct *tty, char *msg); extern void tty_write_message(struct tty_struct *tty, char *msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment