Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 057eb856 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

TTY: add tty_port_register_device helper



This will automatically assign tty_port to tty_driver's port array for
later recall in tty_init_dev. This is intended to be called instead of
tty_register_device.

Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04831dc1
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,15 @@ void tty_port_init(struct tty_port *port)
}
}
EXPORT_SYMBOL(tty_port_init);
EXPORT_SYMBOL(tty_port_init);


struct device *tty_port_register_device(struct tty_port *port,
		struct tty_driver *driver, unsigned index,
		struct device *device)
{
	driver->ports[index] = port;
	return tty_register_device(driver, index, device);
}
EXPORT_SYMBOL_GPL(tty_port_register_device);

int tty_port_alloc_xmit_buf(struct tty_port *port)
int tty_port_alloc_xmit_buf(struct tty_port *port)
{
{
	/* We may sleep in get_zeroed_page() */
	/* We may sleep in get_zeroed_page() */
+3 −0
Original line number Original line Diff line number Diff line
@@ -497,6 +497,9 @@ extern int tty_write_lock(struct tty_struct *tty, int ndelay);
#define tty_is_writelocked(tty)  (mutex_is_locked(&tty->atomic_write_lock))
#define tty_is_writelocked(tty)  (mutex_is_locked(&tty->atomic_write_lock))


extern void tty_port_init(struct tty_port *port);
extern void tty_port_init(struct tty_port *port);
extern struct device *tty_port_register_device(struct tty_port *port,
		struct tty_driver *driver, unsigned index,
		struct device *device);
extern int tty_port_alloc_xmit_buf(struct tty_port *port);
extern int tty_port_alloc_xmit_buf(struct tty_port *port);
extern void tty_port_free_xmit_buf(struct tty_port *port);
extern void tty_port_free_xmit_buf(struct tty_port *port);
extern void tty_port_put(struct tty_port *port);
extern void tty_port_put(struct tty_port *port);