Jiri Slaby
4da872befc
tty: remove empty tty_operations::set_termios
...
tty_operations::set_termios is optional. If it doesn't exist, nothing is
called. So remove almost¹ empty set_termios implementations.
¹ capi had an useless pr_debug in it.
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Cc: Jeff Dike <jdike@addtoit.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: Karsten Keil <isdn@linux-pingi.de >
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com >
Link: https://lore.kernel.org/r/20210505091928.22010-32-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-05-13 18:29:11 +02:00
Jiri Slaby
fff4ef17a9
tty: make tty_operations::chars_in_buffer return uint
...
tty_operations::chars_in_buffer is another hook which is expected to
return values >= 0. So make it explicit by the return type too -- use
unsigned int.
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com >
Acked-by: David Sterba <dsterba@suse.com >
Cc: Jeff Dike <jdike@addtoit.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com >
Cc: Jens Taprogge <jens.taprogge@taprogge.org >
Cc: Karsten Keil <isdn@linux-pingi.de >
Cc: Ulf Hansson <ulf.hansson@linaro.org >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Jakub Kicinski <kuba@kernel.org >
Cc: Heiko Carstens <hca@linux.ibm.com >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: David Lin <dtwlin@gmail.com >
Cc: Johan Hovold <johan@kernel.org >
Cc: Alex Elder <elder@kernel.org >
Cc: Jiri Kosina <jikos@kernel.org >
Cc: Shawn Guo <shawnguo@kernel.org >
Cc: Sascha Hauer <s.hauer@pengutronix.de >
Cc: Oliver Neukum <oneukum@suse.com >
Cc: Felipe Balbi <balbi@kernel.org >
Cc: Mathias Nyman <mathias.nyman@intel.com >
Cc: Marcel Holtmann <marcel@holtmann.org >
Cc: Johan Hedberg <johan.hedberg@gmail.com >
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com >
Link: https://lore.kernel.org/r/20210505091928.22010-27-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-05-13 18:29:11 +02:00
Jiri Slaby
03b3b1a240
tty: make tty_operations::write_room return uint
...
Line disciplines expect a positive value or zero returned from
tty->ops->write_room (invoked by tty_write_room). So make this
assumption explicit by using unsigned int as a return value. Both of
tty->ops->write_room and tty_write_room.
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com >
Acked-by: Alex Elder <elder@linaro.org >
Acked-by: Max Filippov <jcmvbkbc@gmail.com > # xtensa
Acked-by: David Sterba <dsterba@suse.com >
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com >
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Richard Henderson <rth@twiddle.net >
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru >
Cc: Matt Turner <mattst88@gmail.com >
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com >
Cc: Helge Deller <deller@gmx.de >
Cc: Jeff Dike <jdike@addtoit.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: Chris Zankel <chris@zankel.net >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com >
Cc: Jens Taprogge <jens.taprogge@taprogge.org >
Cc: Karsten Keil <isdn@linux-pingi.de >
Cc: Scott Branden <scott.branden@broadcom.com >
Cc: Ulf Hansson <ulf.hansson@linaro.org >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Jakub Kicinski <kuba@kernel.org >
Cc: Heiko Carstens <hca@linux.ibm.com >
Cc: Vasily Gorbik <gor@linux.ibm.com >
Cc: Christian Borntraeger <borntraeger@de.ibm.com >
Cc: David Lin <dtwlin@gmail.com >
Cc: Johan Hovold <johan@kernel.org >
Cc: Jiri Kosina <jikos@kernel.org >
Cc: Shawn Guo <shawnguo@kernel.org >
Cc: Sascha Hauer <s.hauer@pengutronix.de >
Cc: Oliver Neukum <oneukum@suse.com >
Cc: Felipe Balbi <balbi@kernel.org >
Cc: Mathias Nyman <mathias.nyman@intel.com >
Cc: Marcel Holtmann <marcel@holtmann.org >
Cc: Johan Hedberg <johan.hedberg@gmail.com >
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com >
Link: https://lore.kernel.org/r/20210505091928.22010-23-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-05-13 17:03:20 +02:00
Jiri Slaby
96564ac680
um: line, remove put_char
...
um's put_char only calls write. And the tty layer/disciplines do the
same if put_char is NULL.
So we can safely remove this put_char wrapper.
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Cc: Jeff Dike <jdike@addtoit.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com >
Link: https://lore.kernel.org/r/20200615074856.18949-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2020-06-24 16:53:37 +02:00
Alex Dewar
dbddf429dc
um: Add SPDX headers for files in arch/um/drivers
...
Convert files to use SPDX header. All files are licensed under the GPLv2.
Signed-off-by: Alex Dewar <alex.dewar@gmx.co.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2019-09-15 21:37:16 +02:00
Al Viro
37185b3324
um: get rid of pointless include "..." where include <...> will do
...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-10-09 22:28:45 +02:00
Richard Weinberger
a84ccab132
um: remove count_lock
...
this lock is no longer needed.
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-07-28 17:47:59 +02:00
Richard Weinberger
79e0273d18
um: fully use tty_port
...
... use all tty_port helpers
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-07-28 17:47:59 +02:00
Richard Weinberger
d003e982c1
um: remove line_ioctl()
...
line_ioctl() has no real function.
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-07-28 17:47:58 +02:00
Jiri Slaby
6fc58845ad
TTY: um/line, use tty from tty_port
...
This means switching to the tty refcounted model so that we will not
race with interrupts.
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Cc: Jeff Dike <jdike@addtoit.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: user-mode-linux-devel@lists.sourceforge.net
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-07-28 17:47:58 +02:00
Jiri Slaby
060ed31dd9
TTY: um/line, add tty_port
...
And use count from there.
Signed-off-by: Jiri Slaby <jslaby@suse.cz >
Cc: Jeff Dike <jdike@addtoit.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: user-mode-linux-devel@lists.sourceforge.net
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-07-28 17:47:58 +02:00
Al Viro
5eaa3411a8
um: line->have_irq is never checked...
...
looks like a half-arsed duplicate of line->enabled
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-03-25 00:29:54 +01:00
Al Viro
ee4850702b
um: sorting out the chan mess, part 1
...
put references to in and out chans associated with line into
explicit struct chan * fields in it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-03-25 00:29:54 +01:00
Al Viro
04292b2cf8
um: get rid of lines_init()
...
move config-independent parts of initialization into
register_lines(), call setup_one_line() after it instead
of abusing ->init_str.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-03-25 00:29:53 +01:00
Al Viro
cfe6b7c79d
um: switch line.c tty drivers to dynamic device creation
...
Current code doesn't update the symlinks in /sys/dev/char when we add/remove
tty lines. Fixing that allows to stop messing with ->valid before the driver
registration, which is a Good Thing(tm) - we shouldn't have it set before we
really have the things set up and ready for line_open().
We need tty_driver available to call tty_{un,}register_device(), so we just
stash a reference to it into struct line_driver.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-03-25 00:29:53 +01:00
Al Viro
d8c215adbf
um: convert count_lock to mutex, fix a race in line_open()
...
If two processes are opening the same line, the second to get
into line_open() will decide that it doesn't need to do anything
(correctly) or wait for anything. The latter, unfortunately,
is incorrect - the first opener might not be through yet. We
need to have exclusion covering the entire line_init(), including
the blocking parts. Moreover, the next patch will need to
widen the exclusion on mconsole side of things, also including
the blocking bits, so let's just convert that sucker to mutex...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-03-25 00:29:53 +01:00
Al Viro
43574c1afe
um: get rid of the init_prio mess
...
make line_setup() act on a separate array of conf strings + default conf,
have lines array initialized explicitly by that data, bury LINE_INIT()
macro from hell.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2012-03-25 00:29:53 +01:00
Al Viro
510c72a3cf
um: take chan_*.h and line.h to arch/um/drivers
...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: Richard Weinberger <richard@nod.at >
2011-11-02 14:15:12 +01:00