Added a CONFIG_TTY option to allow removal of TTY

The option allows you to remove TTY and compile without errors. This
saves space on systems that won't support TTY interfaces anyway.
bloat-o-meter output is below.

The bulk of this patch consists of Kconfig changes adding "depends on
TTY" to various serial devices and similar drivers that require the TTY
layer.  Ideally, these dependencies would occur on a common intermediate
symbol such as SERIO, but most drivers "select SERIO" rather than
"depends on SERIO", and "select" does not respect dependencies.

add/remove: 0/385 grow/shrink: 2/18 up/down: 14/-54016 (-54002)
function                                     old     new   delta
chr_dev_init                                 193     205     +12
selinux_setprocattr                         1167    1169      +2
static.__warned                              557     556      -1
start_kernel                                 840     835      -5
proc_root_init                               167     162      -5
tty_ldiscs_seq_stop                            6       -      -6
__kstrtab_do_SAK                               7       -      -7
unregister_console                           165     157      -8
tty_class                                      8       -      -8
sys_setsid                                   213     205      -8
redirect                                       8       -      -8
proc_tty_ldisc                                 8       -      -8
proc_tty_driver                                8       -      -8
hung_up_tty_read                               8       -      -8
consdev                                        8       -      -8
__initcall_tty_class_init2                     8       -      -8
__kstrtab_tty_name                             9       -      -9
__kstrtab_tty_lock                             9       -      -9
__kstrtab_stop_tty                             9       -      -9
__kstrtab_tty_mutex                           10       -     -10
__kstrtab_start_tty                           10       -     -10
tty_vhangup                                   11       -     -11
tty_ldisc_ref                                 11       -     -11
tty_ldisc_deref                               11       -     -11
put_tty_driver                                11       -     -11
hung_up_tty_poll                              11       -     -11
deinitialize_tty_struct                       11       -     -11
__kstrtab_tty_wakeup                          11       -     -11
__kstrtab_tty_unlock                          11       -     -11
__kstrtab_tty_hangup                          11       -     -11
__kstrtab_tty_devnum                          11       -     -11
__kstrtab_tty_vhangup                         12       -     -12
tty_set_operations                            13       -     -13
hung_up_tty_write                             13       -     -13
__kstrtab_tty_throttle                        13       -     -13
__kstrtab_tty_shutdown                        13       -     -13
__kstrtab_tty_put_char                        13       -     -13
__kstrtab_tty_port_put                        13       -     -13
__kstrtab_tty_kref_put                        13       -     -13
__kstrtab_tty_get_pgrp                        13       -     -13
__kstrtab_tty_port_open                       14       -     -14
__kstrtab_tty_port_init                       14       -     -14
__kstrtab_tty_ldisc_ref                       14       -     -14
__kstrtab_tty_hung_up_p                       14       -     -14
__kstrtab_tty_write_room                      15       -     -15
__kstrtab_tty_unthrottle                      15       -     -15
__kstrtab_tty_port_close                      15       -     -15
__kstrtab_tty_mode_ioctl                      15       -     -15
__kstrtab_put_tty_driver                      15       -     -15
tty_drivers                                   16       -     -16
sys_vhangup                                   37      21     -16
daemonize                                    689     673     -16
__ksymtab_tty_write_room                      16       -     -16
__ksymtab_tty_wakeup                          16       -     -16
__ksymtab_tty_wait_until_sent                 16       -     -16
__ksymtab_tty_vhangup                         16       -     -16
__ksymtab_tty_unthrottle                      16       -     -16
__ksymtab_tty_unregister_ldisc                16       -     -16
__ksymtab_tty_unregister_driver               16       -     -16
__ksymtab_tty_unregister_device               16       -     -16
__ksymtab_tty_unlock                          16       -     -16
__ksymtab_tty_throttle                        16       -     -16
__ksymtab_tty_termios_input_baud_rate         16       -     -16
__ksymtab_tty_termios_hw_change               16       -     -16
__ksymtab_tty_termios_encode_baud_rate        16       -     -16
__ksymtab_tty_termios_copy_hw                 16       -     -16
__ksymtab_tty_termios_baud_rate               16       -     -16
__ksymtab_tty_std_termios                     16       -     -16
__ksymtab_tty_shutdown                        16       -     -16
__ksymtab_tty_set_termios                     16       -     -16
__ksymtab_tty_set_operations                  16       -     -16
__ksymtab_tty_schedule_flip                   16       -     -16
__ksymtab_tty_register_ldisc                  16       -     -16
__ksymtab_tty_register_driver                 16       -     -16
__ksymtab_tty_register_device                 16       -     -16
__ksymtab_tty_put_char                        16       -     -16
__ksymtab_tty_prepare_flip_string_flags       16       -     -16
__ksymtab_tty_prepare_flip_string             16       -     -16
__ksymtab_tty_port_tty_set                    16       -     -16
__ksymtab_tty_port_tty_get                    16       -     -16
__ksymtab_tty_port_raise_dtr_rts              16       -     -16
__ksymtab_tty_port_put                        16       -     -16
__ksymtab_tty_port_open                       16       -     -16
__ksymtab_tty_port_lower_dtr_rts              16       -     -16
__ksymtab_tty_port_init                       16       -     -16
__ksymtab_tty_port_hangup                     16       -     -16
__ksymtab_tty_port_free_xmit_buf              16       -     -16
__ksymtab_tty_port_close_start                16       -     -16
__ksymtab_tty_port_close_end                  16       -     -16
__ksymtab_tty_port_close                      16       -     -16
__ksymtab_tty_port_carrier_raised             16       -     -16
__ksymtab_tty_port_block_til_ready            16       -     -16
__ksymtab_tty_port_alloc_xmit_buf             16       -     -16
__ksymtab_tty_perform_flush                   16       -     -16
__ksymtab_tty_pair_get_tty                    16       -     -16
__ksymtab_tty_pair_get_pty                    16       -     -16
__ksymtab_tty_name                            16       -     -16
__ksymtab_tty_mutex                           16       -     -16
__ksymtab_tty_mode_ioctl                      16       -     -16
__ksymtab_tty_lock                            16       -     -16
__ksymtab_tty_ldisc_ref_wait                  16       -     -16
__ksymtab_tty_ldisc_ref                       16       -     -16
__ksymtab_tty_ldisc_flush                     16       -     -16
__ksymtab_tty_ldisc_deref                     16       -     -16
__ksymtab_tty_kref_put                        16       -     -16
__ksymtab_tty_insert_flip_string_flags        16       -     -16
__ksymtab_tty_insert_flip_string_fixed_flag      16       -     -16
__ksymtab_tty_init_termios                    16       -     -16
__ksymtab_tty_hung_up_p                       16       -     -16
__ksymtab_tty_hangup                          16       -     -16
__ksymtab_tty_get_pgrp                        16       -     -16
__ksymtab_tty_get_baud_rate                   16       -     -16
__ksymtab_tty_free_termios                    16       -     -16
__ksymtab_tty_flip_buffer_push                16       -     -16
__ksymtab_tty_encode_baud_rate                16       -     -16
__ksymtab_tty_driver_kref_put                 16       -     -16
__ksymtab_tty_driver_flush_buffer             16       -     -16
__ksymtab_tty_devnum                          16       -     -16
__ksymtab_tty_check_change                    16       -     -16
__ksymtab_tty_chars_in_buffer                 16       -     -16
__ksymtab_tty_buffer_request_room             16       -     -16
__ksymtab_stop_tty                            16       -     -16
__ksymtab_start_tty                           16       -     -16
__ksymtab_put_tty_driver                      16       -     -16
__ksymtab_n_tty_ioctl_helper                  16       -     -16
__ksymtab_n_tty_inherit_ops                   16       -     -16
__ksymtab_n_tty_compat_ioctl_helper           16       -     -16
__ksymtab_get_current_tty                     16       -     -16
__ksymtab_do_SAK                              16       -     -16
__ksymtab_alloc_tty_driver                    16       -     -16
__kstrtab_tty_std_termios                     16       -     -16
__kstrtab_tty_set_termios                     16       -     -16
__kstrtab_tty_port_hangup                     16       -     -16
__kstrtab_tty_ldisc_flush                     16       -     -16
__kstrtab_tty_ldisc_deref                     16       -     -16
__kstrtab_get_current_tty                     16       -     -16
ptychar                                       17       -     -17
__kstrtab_tty_port_tty_set                    17       -     -17
__kstrtab_tty_port_tty_get                    17       -     -17
__kstrtab_tty_pair_get_tty                    17       -     -17
__kstrtab_tty_pair_get_pty                    17       -     -17
__kstrtab_tty_init_termios                    17       -     -17
__kstrtab_tty_free_termios                    17       -     -17
__kstrtab_tty_check_change                    17       -     -17
__kstrtab_alloc_tty_driver                    17       -     -17
tty_unlock                                    18       -     -18
tty_hangup                                    18       -     -18
tty_flush_to_ldisc                            18       -     -18
tty_encode_baud_rate                          18       -     -18
t_stop                                        72      54     -18
do_tty_hangup                                 18       -     -18
do_SAK_work                                   18       -     -18
__kstrtab_tty_schedule_flip                   18       -     -18
__kstrtab_tty_perform_flush                   18       -     -18
__kstrtab_tty_get_baud_rate                   18       -     -18
__kstrtab_n_tty_inherit_ops                   18       -     -18
tty_hung_up_p                                 19       -     -19
__kstrtab_tty_set_operations                  19       -     -19
__kstrtab_tty_register_ldisc                  19       -     -19
__kstrtab_tty_port_close_end                  19       -     -19
__kstrtab_tty_ldisc_ref_wait                  19       -     -19
__kstrtab_n_tty_ioctl_helper                  19       -     -19
tty_lock                                      20       -     -20
tty_ldisc_begin                               20       -     -20
dev_match_devt                                20       -     -20
__kstrtab_tty_wait_until_sent                 20       -     -20
__kstrtab_tty_termios_copy_hw                 20       -     -20
__kstrtab_tty_register_driver                 20       -     -20
__kstrtab_tty_register_device                 20       -     -20
__kstrtab_tty_driver_kref_put                 20       -     -20
__kstrtab_tty_chars_in_buffer                 20       -     -20
tty_drivers_open                              21       -     -21
t_next                                       129     108     -21
proc_tty_ldiscs_open                          21       -     -21
__kstrtab_tty_unregister_ldisc                21       -     -21
__kstrtab_tty_port_close_start                21       -     -21
__kstrtab_tty_flip_buffer_push                21       -     -21
__kstrtab_tty_encode_baud_rate                21       -     -21
tty_ldiscs_seq_start                          22       -     -22
__kstrtab_tty_unregister_driver               22       -     -22
__kstrtab_tty_unregister_device               22       -     -22
__kstrtab_tty_termios_hw_change               22       -     -22
__kstrtab_tty_termios_baud_rate               22       -     -22
tty_port_lower_dtr_rts                        23       -     -23
tty_chars_in_buffer                           23       -     -23
do_SAK                                        23       -     -23
__kstrtab_tty_port_raise_dtr_rts              23       -     -23
__kstrtab_tty_port_lower_dtr_rts              23       -     -23
__kstrtab_tty_port_free_xmit_buf              23       -     -23
tty_driver_flush_buffer                       24       -     -24
__kstrtab_tty_prepare_flip_string             24       -     -24
__kstrtab_tty_port_carrier_raised             24       -     -24
__kstrtab_tty_port_alloc_xmit_buf             24       -     -24
__kstrtab_tty_driver_flush_buffer             24       -     -24
__kstrtab_tty_buffer_request_room             24       -     -24
tty_port_carrier_raised                       25       -     -25
__kstrtab_tty_port_block_til_ready            25       -     -25
tty_write_room                                26       -     -26
tty_port_raise_dtr_rts                        26       -     -26
__kstrtab_n_tty_compat_ioctl_helper           26       -     -26
tty_devnum                                    28       -     -28
__kstrtab_tty_termios_input_baud_rate         28       -     -28
tty_ldisc_halt                                29       -     -29
__kstrtab_tty_termios_encode_baud_rate        29       -     -29
__kstrtab_tty_insert_flip_string_flags        29       -     -29
hung_up_tty_ioctl                             30       -     -30
hung_up_tty_compat_ioctl                      30       -     -30
__kstrtab_tty_prepare_flip_string_flags       30       -     -30
tty_pair_get_pty                              32       -     -32
tty_ldiscs_seq_ops                            32       -     -32
tty_ldiscs_seq_next                           32       -     -32
tty_free_file                                 32       -     -32
tty_drivers_op                                32       -     -32
static.do_acct_process                       838     806     -32
release_task                                1157    1125     -32
__kstrtab_tty_insert_flip_string_fixed_flag      34       -     -34
tty_unregister_device                         35       -     -35
n_tty_compat_ioctl_helper                     35       -     -35
console_sysfs_notify                          36       -     -36
do_exit                                     2325    2288     -37
alloc_tty_struct                              38       -     -38
console_init                                  39       -     -39
tty_pair_get_tty                              41       -     -41
tty_ldisc_deinit                              42       -     -42
tty_kref_put                                  42       -     -42
tty_driver_kref_put                           42       -     -42
tty_termios_copy_hw                           43       -     -43
tty_devnode                                   43       -     -43
tty_std_termios                               44       -     -44
tty_vhangup_self                              45       -     -45
tty_ldisc_enable                              46       -     -46
t_start                                      269     221     -48
dev_attr_active                               48       -     -48
tty_port_put                                  50       -     -50
no_tty                                        50       -     -50
tty_termios_hw_change                         51       -     -51
tty_class_init                                52       -     -52
n_tty_inherit_ops                             52       -     -52
tty_driver_remove_tty                         53       -     -53
tty_put_char                                  54       -     -54
tty_ldisc_init                                55       -     -55
tty_ldisc_flush_works                         55       -     -55
tty_ldisc_lock                                56       -     -56
tty_files_lock                                56       -     -56
redirect_lock                                 56       -     -56
proc_tty_unregister_driver                    56       -     -56
n_tty_write_wakeup                            56       -     -56
tty_write_unlock                              58       -     -58
session_clear_tty                             59       -     -59
is_ignored                                    60       -     -60
free_tty_struct                               61       -     -61
tty_free_termios                              64       -     -64
release_tty                                   68       -     -68
tty_fasync                                    69       -     -69
static.__func__                            18289   18219     -70
do_task_stat                                2962    2892     -70
tty_ldisc_wait                                72       -     -72
tty_ldisc_idle                                72       -     -72
tty_name                                      75       -     -75
tty_ldisc_flush                               75       -     -75
tty_get_pgrp                                  76       -     -76
tty_set_termios_ldisc                         77       -     -77
tty_alloc_file                                78       -     -78
alloc_tty_driver                              79       -     -79
tty_port_close                                80       -     -80
n_tty_close                                   80       -     -80
echo_set_canon_col                            80       -     -80
tty_port_free_xmit_buf                        84       -     -84
tty_write_lock                                85       -     -85
tty_termios_baud_rate                         85       -     -85
tty_schedule_flip                             85       -     -85
tty_throttle                                  87       -     -87
tty_prepare_flip_string_flags                 89       -     -89
static.tty_ldisc_close                        89       -     -89
tty_unthrottle                                90       -     -90
tty_shutdown                                  90       -     -90
tty_ldisc_try                                 91       -     -91
tty_default_fops                              94       -     -94
process_output                                94       -     -94
tty_port_destructor                           95       -     -95
tty_register_ldisc                            98       -     -98
static.tty_ldisc_open                         98       -     -98
proc_tty_register_driver                      98       -     -98
tty_prepare_flip_string                       99       -     -99
tty_port_alloc_xmit_buf                       99       -     -99
tty_paranoia_check                            99       -     -99
tty_termios_input_baud_rate                  101       -    -101
proc_clear_tty                               103       -    -103
tty_cdev                                     104       -    -104
console_cdev                                 104       -    -104
tty_port_tty_get                             106       -    -106
tty_get_baud_rate                            107       -    -107
tty_port_shutdown                            108       -    -108
n_tty_set_room                               108       -    -108
tty_add_file                                 109       -    -109
tty_ldisc_reinit                             110       -    -110
tty_flip_buffer_push                         111       -    -111
tty_del_file                                 111       -    -111
tty_unregister_ldisc                         112       -    -112
tty_wakeup                                   114       -    -114
echo_char_raw                                116       -    -116
copy_termios                                 116       -    -116
proc_tty_init                                124       -    -124
baud_table                                   124       -    -124
baud_bits                                    124       -    -124
tty_write_message                            126       -    -126
flush_unauthorized_files                     740     614    -126
tty_port_tty_set                             127       -    -127
tty_unregister_driver                        128       -    -128
put_tty_queue                                128       -    -128
tty_buffer_free_all                          135       -    -135
queue_release_one_tty                        135       -    -135
get_current_tty                              135       -    -135
tty_mutex                                    136       -    -136
big_tty_mutex                                136       -    -136
n_tty_receive_overrun                        139       -    -139
n_tty_flush_buffer                           139       -    -139
tty_ldisc_setup                              144       -    -144
tty_ldiscs_seq_show                          148       -    -148
__tty_buffer_flush                           149       -    -149
tty_ldisc_ref_wait                           150       -    -150
tty_poll                                     151       -    -151
tty_ldisc_release                            151       -    -151
tty_ldisc_N_TTY                              152       -    -152
tty_buffer_init                              159       -    -159
n_tty_chars_in_buffer                        159       -    -159
static._rs                                  1440    1280    -160
put_ldisc                                    165       -    -165
tty_port_hangup                              166       -    -166
static.tty_ldisc_wait_idle                   166       -    -166
add_echo_byte                                167       -    -167
send_prio_char                               172       -    -172
static.__key                                8560    8384    -176
redirected_tty_write                         178       -    -178
echo_char                                    180       -    -180
release_one_tty                              183       -    -183
tty_perform_flush                            184       -    -184
tty_change_softcar                           192       -    -192
stop_tty                                     192       -    -192
check_tty_count                              193       -    -193
tty_insert_flip_string_fixed_flag            194       -    -194
tty_insert_flip_string_flags                 197       -    -197
send_break                                   203       -    -203
tty_port_close_end                           206       -    -206
destruct_tty_driver                          207       -    -207
tty_ldiscs_proc_fops                         208       -    -208
tty_fops                                     208       -    -208
proc_tty_drivers_operations                  208       -    -208
hung_up_tty_fops                             208       -    -208
console_fops                                 208       -    -208
get_termio                                   209       -    -209
tty_compat_ioctl                             210       -    -210
start_tty                                    211       -    -211
tty_do_resize                                213       -    -213
n_tty_ioctl                                  215       -    -215
tty_port_open                                216       -    -216
static.tty_ldisc_restore                     216       -    -216
tty_read                                     226       -    -226
show_cons_active                             232       -    -232
tty_buffer_flush                             238       -    -238
get_ldops                                    239       -    -239
tty_ldiscs                                   240       -    -240
set_termiox                                  247       -    -247
tty_init_termios                             253       -    -253
tty_check_change                             256       -    -256
tty_ldisc_get                                257       -    -257
tty_register_device                          262       -    -262
n_tty_open                                   266       -    -266
tty_wait_until_sent                          274       -    -274
tty_init                                     302       -    -302
show_tty_driver                              305       -    -305
reset_buffer_flags                           314       -    -314
tty_termios_encode_baud_rate                 325       -    -325
__proc_set_tty                               343       -    -343
copy_from_read_buf                           347       -    -347
tty_port_init                                354       -    -354
__tty_fasync                                 376       -    -376
tty_buffer_request_room                      386       -    -386
flush_to_ldisc                               448       -    -448
n_tty_poll                                   479       -    -479
n_tty_ioctl_helper                           492       -    -492
tty_port_close_start                         514       -    -514
__do_SAK                                     530       -    -530
do_output_char                               542       -    -542
tty_init_dev                                 546       -    -546
show_tty_range                               556       -    -556
set_termios                                  582       -    -582
disassociate_ctty                            582       -    -582
tty_write                                    669       -    -669
tty_set_termios                              755       -    -755
tty_port_block_til_ready                     757       -    -757
tty_set_ldisc                                767       -    -767
tty_register_driver                          771       -    -771
tty_ldisc_hangup                             781       -    -781
initialize_tty_struct                        802       -    -802
process_echoes                               815       -    -815
__tty_hangup                                 960       -    -960
n_tty_set_termios                           1086       -   -1086
n_tty_write                                 1126       -   -1126
tty_mode_ioctl                              1281       -   -1281
tty_release                                 1314       -   -1314
tty_open                                    1449       -   -1449
n_tty_read                                  2201       -   -2201
tty_ioctl                                   3141       -   -3141
n_tty_receive_buf                           4629       -   -4629

Signed-off-by: Joe Millenbach <jmillenbach@gmail.com>