@@ -77,13 +77,6 @@ static const struct old_serial_port old_serial_port[] = {
7777
7878#define UART_NR CONFIG_SERIAL_8250_NR_UARTS
7979
80- #ifdef CONFIG_SERIAL_8250_RSA
81-
82- #define PORT_RSA_MAX 4
83- static unsigned long probe_rsa [PORT_RSA_MAX ];
84- static unsigned int probe_rsa_count ;
85- #endif /* CONFIG_SERIAL_8250_RSA */
86-
8780struct irq_info {
8881 struct hlist_node node ;
8982 int irq ;
@@ -348,44 +341,7 @@ static void univ8250_release_irq(struct uart_8250_port *up)
348341 serial_unlink_irq_chain (up );
349342}
350343
351- #ifdef CONFIG_SERIAL_8250_RSA
352- static int serial8250_request_rsa_resource (struct uart_8250_port * up )
353- {
354- unsigned long start = UART_RSA_BASE << up -> port .regshift ;
355- unsigned int size = 8 << up -> port .regshift ;
356- struct uart_port * port = & up -> port ;
357- int ret = - EINVAL ;
358-
359- switch (port -> iotype ) {
360- case UPIO_HUB6 :
361- case UPIO_PORT :
362- start += port -> iobase ;
363- if (request_region (start , size , "serial-rsa" ))
364- ret = 0 ;
365- else
366- ret = - EBUSY ;
367- break ;
368- }
369-
370- return ret ;
371- }
372-
373- static void serial8250_release_rsa_resource (struct uart_8250_port * up )
374- {
375- unsigned long offset = UART_RSA_BASE << up -> port .regshift ;
376- unsigned int size = 8 << up -> port .regshift ;
377- struct uart_port * port = & up -> port ;
378-
379- switch (port -> iotype ) {
380- case UPIO_HUB6 :
381- case UPIO_PORT :
382- release_region (port -> iobase + offset , size );
383- break ;
384- }
385- }
386- #endif
387-
388- static const struct uart_ops * base_ops ;
344+ const struct uart_ops * univ8250_port_base_ops = NULL ;
389345static struct uart_ops univ8250_port_ops ;
390346
391347static const struct uart_8250_ops univ8250_driver_ops = {
@@ -424,69 +380,6 @@ void serial8250_set_isa_configurator(
424380}
425381EXPORT_SYMBOL (serial8250_set_isa_configurator );
426382
427- #ifdef CONFIG_SERIAL_8250_RSA
428-
429- static void univ8250_config_port (struct uart_port * port , int flags )
430- {
431- struct uart_8250_port * up = up_to_u8250p (port );
432-
433- up -> probe &= ~UART_PROBE_RSA ;
434- if (port -> type == PORT_RSA ) {
435- if (serial8250_request_rsa_resource (up ) == 0 )
436- up -> probe |= UART_PROBE_RSA ;
437- } else if (flags & UART_CONFIG_TYPE ) {
438- int i ;
439-
440- for (i = 0 ; i < probe_rsa_count ; i ++ ) {
441- if (probe_rsa [i ] == up -> port .iobase ) {
442- if (serial8250_request_rsa_resource (up ) == 0 )
443- up -> probe |= UART_PROBE_RSA ;
444- break ;
445- }
446- }
447- }
448-
449- base_ops -> config_port (port , flags );
450-
451- if (port -> type != PORT_RSA && up -> probe & UART_PROBE_RSA )
452- serial8250_release_rsa_resource (up );
453- }
454-
455- static int univ8250_request_port (struct uart_port * port )
456- {
457- struct uart_8250_port * up = up_to_u8250p (port );
458- int ret ;
459-
460- ret = base_ops -> request_port (port );
461- if (ret == 0 && port -> type == PORT_RSA ) {
462- ret = serial8250_request_rsa_resource (up );
463- if (ret < 0 )
464- base_ops -> release_port (port );
465- }
466-
467- return ret ;
468- }
469-
470- static void univ8250_release_port (struct uart_port * port )
471- {
472- struct uart_8250_port * up = up_to_u8250p (port );
473-
474- if (port -> type == PORT_RSA )
475- serial8250_release_rsa_resource (up );
476- base_ops -> release_port (port );
477- }
478-
479- static void univ8250_rsa_support (struct uart_ops * ops )
480- {
481- ops -> config_port = univ8250_config_port ;
482- ops -> request_port = univ8250_request_port ;
483- ops -> release_port = univ8250_release_port ;
484- }
485-
486- #else
487- #define univ8250_rsa_support (x ) do { } while (0)
488- #endif /* CONFIG_SERIAL_8250_RSA */
489-
490383static inline void serial8250_apply_quirks (struct uart_8250_port * up )
491384{
492385 up -> port .quirks |= skip_txen_test ? UPQ_NO_TXEN_TEST : 0 ;
@@ -504,8 +397,8 @@ static struct uart_8250_port *serial8250_setup_port(int index)
504397 up -> port .port_id = index ;
505398
506399 serial8250_init_port (up );
507- if (!base_ops )
508- base_ops = up -> port .ops ;
400+ if (!univ8250_port_base_ops )
401+ univ8250_port_base_ops = up -> port .ops ;
509402 up -> port .ops = & univ8250_port_ops ;
510403
511404 timer_setup (& up -> timer , serial8250_timeout , 0 );
@@ -539,7 +432,7 @@ static void __init serial8250_isa_init_ports(void)
539432 serial8250_setup_port (i );
540433
541434 /* chain base port ops to support Remote Supervisor Adapter */
542- univ8250_port_ops = * base_ops ;
435+ univ8250_port_ops = * univ8250_port_base_ops ;
543436 univ8250_rsa_support (& univ8250_port_ops );
544437
545438 if (share_irqs )
@@ -1312,10 +1205,6 @@ MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STR
13121205module_param (skip_txen_test , uint , 0644 );
13131206MODULE_PARM_DESC (skip_txen_test , "Skip checking for the TXEN bug at init time" );
13141207
1315- #ifdef CONFIG_SERIAL_8250_RSA
1316- module_param_hw_array (probe_rsa , ulong , ioport , & probe_rsa_count , 0444 );
1317- MODULE_PARM_DESC (probe_rsa , "Probe I/O ports for RSA" );
1318- #endif
13191208MODULE_ALIAS_CHARDEV_MAJOR (TTY_MAJOR );
13201209
13211210#ifdef CONFIG_SERIAL_8250_DEPRECATED_OPTIONS
@@ -1338,11 +1227,6 @@ static void __used s8250_options(void)
13381227 module_param_cb (share_irqs , & param_ops_uint , & share_irqs , 0644 );
13391228 module_param_cb (nr_uarts , & param_ops_uint , & nr_uarts , 0644 );
13401229 module_param_cb (skip_txen_test , & param_ops_uint , & skip_txen_test , 0644 );
1341- #ifdef CONFIG_SERIAL_8250_RSA
1342- __module_param_call (MODULE_PARAM_PREFIX , probe_rsa ,
1343- & param_array_ops , .arr = & __param_arr_probe_rsa ,
1344- 0444 , -1 , 0 );
1345- #endif
13461230}
13471231#else
13481232MODULE_ALIAS ("8250_core" );
0 commit comments