Messages in this thread Patch in this message | | | Date | Sun, 9 Jul 2017 13:32:31 +0100 | From | Okash Khawaja <> | Subject | [patch 4/3] tty: make tty_kopen return ENODEV in case of no TTY |
| |
When TTY is not built, tty_kopen should return an error. This way calling code remains consistent, regardless of whether tty is built or not. This patch returns -ENODEV when there is no tty.
Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
--- include/linux/tty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -423,7 +423,7 @@ static inline int __init tty_init(void) static inline const char *tty_name(const struct tty_struct *tty) { return "(none)"; } static inline struct tty_struct *tty_kopen(dev_t device) -{ return NULL; } +{ return ERR_PTR(-ENODEV); } static inline int tty_dev_name_to_number(const char *name, dev_t *number) { return -ENOTSUPP; } #endif
| |